How to recreate the skill MP Rage from Kingdom Hearts?

Hi all,
I'm trying to recreate a skill called MP Rage in MV. The skill has been featured in the Kingdom Hearts series and the way it works
is that when a character takes damage, a certain amount of MP is restored based on the damage they took.
I would like to try and create something similar in MV. Does anyone have any ideas for an easy way to do this or are there any
existing plugins that could be used to create this effect?
That sounds similar to the TP by damage feature that is default.
have you tried to look for plugins that simulate that?
That can easily be replicated with Yanfly's Auto Passive States and Buffs & States Core.

Have the skill give the user a passive state. Inside the state, you'll put the notetag:
Code:
<Custom Respond Effect>
target.gainMp(value/10);
</Custom Respond Effect>

That's giving them 10% of the damage as mana, you'd replace the equation with whatever you want.
That can easily be replicated with Yanfly's Auto Passive States and Buffs & States Core.

Have the skill give the user a passive state. Inside the state, you'll put the notetag:
Code:
<Custom Respond Effect>
target.gainMp(value/10);
</Custom Respond Effect>

That's giving them 10% of the damage as mana, you'd replace the equation with whatever you want.
You may want to ceil, round or floor the "value/10", or your mana may become x.yy after the hit if I remember correctly.
Thanks, I'll try out what was suggested.
You may want to ceil, round or floor the "value/10", or your mana may become x.yy after the hit if I remember correctly.
That did happen. How would I need to write the code in order for the value to round?
That did happen. How would I need to write the code in order for the value to round?
target.gainMp(Math.floor(value/10));

You may want to ceil, round or floor the "value/10", or your mana may become x.yy after the hit if I remember correctly.
Thanks. For some reason, I had it in my head that the default gain functions already did that, and you needed a plugin to allow decimal stats.
That did happen. How would I need to write the code in order for the value to round?
Math.floor(formula) for always round down, Math.ceil(formula) for always round up, or just Math.round(formula) to round down or up based on the first decimal number.
Thanks for the help everyone, it works just as I had hoped.

Original thread: https://forums.rpgmakerweb.com/threads/how-to-recreate-the-skill-mp-rage-from-kingdom-hearts.139779/