Is there a way to make skills use a percentage of the user's current MP as a basis for HP recovery?

Hello, sorry if this is posted in some way incorrectly. I'm new here, so I apologise if this question has already been answered over and over. I also apologise for the confusing thread name, I couldn't think of a better alternative wording.

I'm trying to make a skill that takes 100% of the user's current MP and then heals the HP of all allies by double the amount of MP used. I know that's a bit confusing but basically for example, 200MP would heal all allies for 400HP.

The only problem is I have problems with math, and I can really only make simple formulas and this just seems above me. So if anyone could help me with this formula and explain it so that I can try to understand how it works so that I could use it to make more skills that would be amazing.

If anyone knows a script or something that could help me with future issues of this kind as well that would be great. I understand the hard answer to this is just to learn, but still I appreciate the help nonetheless.
If I remember correctly, and if I've understood you correctly, you want something like this:
Screenshot (50).png

If that's what you need, then great!
If not, then just let me know!
Do as @DragonRunner said. But for the price, you need Yanfly's Skill Core. Once you have the plugin, place this code in the notetag box:
<Custom MP Cost>
cost = a.mp;
</Custom MP Cost>,
so that all the current mp is used.
@DragonRunner That's very helpful. Thanks so much for that!

@Zarsla That appears to solve my issue, so thanks very much for helping me out!
@Zarsla Sorry to bother again, but I input the code you pasted into the note tags after adding Yanfly's Skill Core and I thought it was working and it half is, the HP is being restored by double the MP, but it doesn't take the MP after it's used? Am I doing something wrong here?
@Zarsla Sorry to bother again, but I input the code you pasted into the note tags after adding Yanfly's Skill Core and I thought it was working and it half is, the HP is being restored by double the MP, but it doesn't take the MP after it's used? Am I doing something wrong here?

OK, so I'm not Zarsla, but I may be able to help.

I watched the Skill Core video on the Yanfly page, and they're using this:

<MP Cost: x>

So logic should dictate that you would need this in the Note box:

<MP Cost: a.mp>

I'll have a go myself, but please let me know how it works (or doesn't) for you!

EDIT 1: Oh, Zarsla's using Lunatic Mode coding! ...that should work, then!
I tried <MP Cost: a.mp> and it's still not taking the MP. I have absolutely no idea what Lunatic Mode is, so I'm probably just missing something. I'm gonna try messing around with it and see if I can't make it work.

EDIT: I finally got it to work. I had to brute force some variables until they worked properly. I DID get Yanfly to work as well, but the problem I had is that Yanfly takes the MP before the spell completes, so I had to make it so when the spell is cast, it heals, then a variable becomes the number of the user's max MP and then MP is subtracted by that amount. So unconventional, yes. But at least it works.

Thanks for everyone's help. It was very much appreciated.
I tried <MP Cost: a.mp> and it's still not taking the MP. I have absolutely no idea what Lunatic Mode is, so I'm probably just missing something. I'm gonna try messing around with it and see if I can't make it work.

EDIT: I finally got it to work. I had to brute force some variables until they worked properly. I DID get Yanfly to work as well, but the problem I had is that Yanfly takes the MP before the spell completes, so I had to make it so when the spell is cast, it heals, then a variable becomes the number of the user's max MP and then MP is subtracted by that amount. So unconventional, yes. But at least it works.

Thanks for everyone's help. It was very much appreciated.

That's good!

"Lunatic Mode" - which is what Zarsla used - is normally used by people who have some knowledge of Javascript, and allows them to create more complex scripts in Yanfly scripts. (If I've got that wrong, someone will hopefully correct me!)

Original thread: https://forums.rpgmakerweb.com/threads/is-there-a-way-to-make-skills-use-a-percentage-of-the-users-current-mp-as-a-basis-for-hp-recovery.83574/