Fainting when running out of MP (help)

Hello! This is my first post. 🙂
How are you all doing?

Ok, so I've been making my project for a month now, and I wanted to know if there is any way I can make a character that dies/faints when he runs out of MP. My idea is that the caracer uses batteries to use skills/magic. So when he runs out of MP, he faints and you have to take him to a charging station.
So my question is, is there any way to make that? Even a script would help.
If he's the only character that uses MP, you may be able to set it up as a common event. If other characters use MP, it may be easier to use a different bar and specify what happens when that is out. It's more work, but it's doable. I don't know how close it will get you but I believe there are some plugins that do some similar things and can be added in rather easily.
Try Yanfly Auto Passive States + Himeworks Custom Death States.

Also Make Sure that Himeworks plugin are under any and all Yanfly's plugins and make sure that any and all Yanfly Plugins follow the order found here. You may need YEP Core Engine for Auto-Passive States to work.
(Also if any conflicts with other plugins happen, and you post bacl here for help, please post with an image/description of the problem along with any and all plugins you have & the order you have them in the plugin manager. As well as any edits you made to core game scripts, if any)

Make a new state with this in the notetag:

<custom death state>


<Custom Passive Condition>
if (user.mp < 1) {
condition = true;
} else {
condition = false;
}
</Custom Passive Condition>


Then add the passive state to the actor or classes you want affected by this.
Try Yanfly Auto Passive States + Himeworks Custom Death States.

Also Make Sure that Himeworks plugin are under any and all Yanfly's plugins and make sure that any and all Yanfly Plugins follow the order found here. You may need YEP Core Engine for Auto-Passive States to work.
(Also if any conflicts with other plugins happen, and you post bacl here for help, please post with an image/description of the problem along with any and all plugins you have & the order you have them in the plugin manager. As well as any edits you made to core game scripts, if any)

Make a new state with this in the notetag:

<custom death state>


<Custom Passive Condition>
if (user.mp < 1) {
condition = true;
} else {
condition = false;
}
</Custom Passive Condition>


Then add the passive state to the actor or classes you want affected by this.

I'm going for this one. But I think that Hime's custom deaths only work if every character in the party is affected by the state. I need only one character to faint when he runs out of MP.

EDIT: I will try to upload screenshots of what I'm doing later.

(Ignore the fact that my RPG maker edition is in spanish)

aaa2.png
aaa1.png

Original thread: https://forums.rpgmakerweb.com/threads/fainting-when-running-out-of-mp-help.90015/