Damage formulas

i want to make a skill that deals more damage when the enemy hp is below 50% am i doing something wrong?

b.hp<mhp*0.5 ? a.atk*5-b.def*2: a.atk-b.def
<mhp of what? If anything, it'll have to be b.mhp.
i want to make a skill that deals more damage when the enemy hp is below 50% am i doing something wrong?

b.hp<mhp*0.5 ? a.atk*5-b.def*2: a.atk-b.def
There is an hpRate() function in the system you can use:
JavaScript:
b.hpRate() < .5 ? a.atk * 5 - b.def * 2 : a.atk - b.def

Original thread: https://forums.rpgmakerweb.com/threads/damage-formulas.169276/