Absorbing Damage into MP?

I'm wondering if there's a plugin that adds a way to create a state that makes it so that, when a character is attacked, they gain MP equal to the amount of damage they received. Is anyone aware of a way to do this?
On state using yanfly statebuff core


<Custom Respond Effect>


target.gainMp(value)


</Custom Respond Effect>

Original thread: https://forums.rpgmakerweb.com/threads/absorbing-damage-into-mp.72671/