There are two ways to do this:
1. Make a transformer or boost converter to guarantee you have at least 12V. The boost converter can't drop voltage, the lowest it goes is to act as a straight wire, so you could do a voltage regulator to drop it. This can generate buttloads of heat, if you have 18V@5 amps to 12V, that's 30 watts of heat!
2. Look up a "buck boost converter" instead. Cascade works well, but requires two inductors and for the currents you mention they'll need to be big 'uns, and two PWM inputs. There's the Cuk converter too, only one PWM stage, but it will invert the output to positive ground.