Making a skill that deals more damage at low HP?

So, what I'm looking for is not exactly a "As HP lowers, damage increases" skill in the way of an exponential growth, (I actually found a way of doing that on accident while trying to build this one, though it's kinda weird...), but rather a skill that deals Y damage (Y being the formula, such as "a.atk * 0.5") when the user is at greater than X% health, and "Y*mult" damage (So like "a.atk * 0.5 * 3") at X% and lower. Is there a way to do this, or am I stuck with increasing damage as HP decreases as a whole?


The formula I found is "Y / (a.hp/a.mhp)" which divides the character's current hp by the character's maximum hp and then divides X by that number, but I don't like it as much because, as mentioned, I'm not looking for an exponential growth, which this formula gives me (As health halves, damage doubles. I.e., it deals 2x damage at 50%, like I want, but then 1.33x damage at 75% and 4x damage at 25% hp, which I don't want it to do). I just want a skill that deals a certain amount of damage, and double that if the user is at half health or less.
Code:
(original formula) * (a.hp_rate < 0.5 ? 2 : 1)
Oh, I didn't know there's something like a.hp_rate. Good to know! 🙂
(original formula) * (a.hp_rate < 0.5 ? 2 : 1)



Okay, thanks Victor Sant! 🙂

Original thread: https://forums.rpgmakerweb.com/threads/making-a-skill-that-deals-more-damage-at-low-hp.57659/