Recoil and Damage Scaling Formula Help

Hey there. I'm having some trouble with a custom formula of mine. I want the skill to cause recoil damage and make the attack less powerful as HP decreases. As two separate skills this is fine and easy, but together I run into errors, I either get an error or it only factors in one part. Here are the formulas for each:

Damage lessen on HP loss:  c=a.atk;[c*2*a.hp_rate,c/2].max

Recoil Damage: c=5 * a.atk - 2 * b.def;a.hp -= c/2;c

Thanks
what do you mean by together? you mean like you combined those two formulas? if yes, can we see the combined one?
Yeah combining the two formulas together. When I try it either one part (like recoil) will overwrite the scaled HP damage formula. My other attempts result in failure. Here's what I have:

c=8 * a.atk - 2 * b.def;a.hp -= c/2;+d=a.atk;[d*2*a.hp_rate,d/2].max;d;c
as far I can see, that will return c

it would probably error if you really have that ;+d there...

your last three ; doesn't make any sense btw...

try this:

Code:
c=8 * a.atk - 2 * b.def;a.hp -= c/2;d=a.atk;[d*2*a.hp_rate,d/2].max
Ah brilliant this worked perfectly, thanks!~
always ensure that the damage that you want will be the last part of your formula, because the engine will by default always use that last line as damage 🙂

Original thread: https://forums.rpgmakerweb.com/threads/recoil-and-damage-scaling-formula-help.23638/