Creating a state that converts Damage to Mana

I'm trying to create a state that converts 5% of any damage taken into mana. For example, if a party member with this state takes 1000 damage, they will take all (1000) damage, but recover 50 mana. However, I'm struggling to find a way to create this state.

Is it possible to create a state like this using the tools avaliable, or would it require scripts?
You could use my Mana Shield script.

You'd use this notetag in a state's notebox:

Code:
<replenish_mp: 5%>
It sounds perfect, although the dropbox link on your site doesn't seem to be working for me - do you have a direct link to the script? Dropbox has always been a little shaky for me. 
Sure, try this link.
Seems to work perfectly - I'll update this thread if something breaks during later testing, but for now, thank you!  😀
You could use my Mana Shield script.

You'd use this notetag in a state's notebox:

<replenish_mp: 5%>
Hey Alistair, I just left a comment on your blog as well, but it seems like most of the dropbox links aren't working (everything older than Mirror Sprites). Loving your Lunatic addons so far though!

EDIT: Had nothing better to do so I tested more extensively... these scripts need reuploading of some degree:

-Lose MP

-Thorns Aura

-Mana Shield

-Custom Prices

Thanks!!
Weird. I'll check them out. Thanks for pointing that out.

Original thread: https://forums.rpgmakerweb.com/threads/creating-a-state-that-converts-damage-to-mana.42919/