How to make MP drain when using an item?

Hello! I spent few hours trying to figure out how should it work correctly. I gave up and I hope I can get some answers.
So, my point is basically, I want the MP to drain when using the flashlight (item). Let's say every 60 seconds it drains 3 points of MP. I want to make a system where the MP is the flashlight life, and batteries are used to restore the MP. The batteries work fine, they restore the MP. But the MP doesn't drain when using the flashlight! I tried this by using the common events, but it only works if I put the minus value in the "Turn off flashlight" common event. Otherwise nothing happens. I use Victor Light Effect script. Here are some screenshots of what I have so far:
Spoiler
flashh.png


flasshon.png


flasshhoff.png


batterysys.png
Trigger a switch and use a parallel process common event that lowers MP each second (using a wait command). If MP are 0 then the torchlight runs out. You can put everything in the same common event.
Trigger a switch and use a parallel process common event that lowers MP each second (using a wait command). If MP are 0 then the torchlight runs out. You can put everything in the same common event.
Hey, hey, it works! Thank you so much! I was missing the variable for the player MP and I didn't set the conditional branch. Now it works like charm. I have one more small question: Is there a way to display MP status somewhere on the screen once flashlight is activated?
Is there a way to display MP status somewhere on the screen once flashlight is activated?
This is going to need a script. So it's a different request. I suggest u start a new one in the RGSS3 request forum.
It is theoretically doable with a script call but I do not recommend doing it. You have to be careful and properly delete the bar when needed. I would definitely do it with a script rather than relying on a script call.
This is going to need a script. So it's a different request. I suggest u start a new one in the RGSS3 request forum.
It is theoretically doable with a script call but I do not recommend doing it. You have to be careful and properly delete the bar when needed. I would definitely do it with a script rather than relying on a script call.
Alright, thanks for help! 🙂

Original thread: https://forums.rpgmakerweb.com/threads/how-to-make-mp-drain-when-using-an-item.108660/