Passive heal state issue (Yanfly)

Hi everyone,
been trying to create an automated system where each battler recovers 25% of their MDef as Hp and Mp each turn.
I'm using the http://yanfly.moe/2015/12/04/yep-37-status-menu-core/ (Status menu core) and http://yanfly.moe/2015/10/17/yep-13-auto-passive-states/ (Auto Passive States).

I'm pretty sure it has something to do with rounding the variables, but as I know very little about javascript I'm not sure how to fix it. This is my current simple state (based off Yanfly's code for http://yanfly.moe/2016/03/26/tips-tricks-warmogs-armor/ )

<Custom Regenerate Effect>
var value = Math.ceil(user.mdef*0.25);
user.gainHp(value);
user.gainMp(value);
</Custom Regenerate Effect>

And this is the error I'm getting
Spoiler
float.png

Thanks!
It should be user.mdf, not user.mdef 😀
It should be user.mdf, not user.mdef 😀
Thanks, that was stupid of me.

Still, for some reason it's still not working. Whenever you knock out a creature they just come back to life the next round. I figured I can alter the code a bit so it wouldn't heal them at 0, but they still do come back.
My code atm:

<Custom Regenerate Effect>
var value = user.mdf*0.25;
if (user.Hp <= 0)
{
}
else
{
user.gainHp(value);
user.gainMp(value);
}
</Custom Regenerate Effect>
I think you can just use "if (user.isAlive())" to check if it is still alive.
That worked, thank you! 🙂

Original thread: https://forums.rpgmakerweb.com/threads/passive-heal-state-issue-yanfly.93717/