I'm wanting to make a skill similar to the Minus Strike ability from the Final Fantasy games to where the attack strength depends on the difference between your Max HP and Current HP.
For example: 9999 is my max hp but I'm at 3000 so it does 6999 total.
I'm unsure how exactly I'd make the formula for this. Can someone help me with the formula, please?
Include the user's max HP (I believe this is a.mhp but it might be a.maxhp) and the user's current HP (a.hp) somewhere logical in the damage formula.
For example, your formula could be a.atk * 4 * (1 + (a.mhp - a.hp) / a.mhp) - b.def * 2 This formula will increase your initial damage (before the reduction for the target's defense) by up to 100% based on the user's missing HP.
I forget whether precision is important in damage formulas like this in VX Ace, so if you notice that the above formula's damage does not seem to increase based on the user's missing HP, try this instead: (a.atk * 4.00 * ((100.00 + (((a.mhp * 100.00) - (a.hp * 100.00)) / a.mhp)) / 100.00)) - (b.def * 2) This formula is mathematically the same as above, but never attempts to multiply the "a.atk * 4" part by an integer value which could just round to "1".
If you want just the basic Minus Strike, it's a.mhp - a.hp (user's max minus current). Wave gave a way to incorporate the difference percentage if you want to have Attack and Defense influence the damage (aka increase damage for a regular formula). Alternatively, I could use 1.0 - a.hp_rate as hp_rate is hp/mhp (meaning that 200/1000 is a 0.2 hp_rate thus the difference would be 0.8 aka 800/1000.