Reducing the party leaders MP by a set number

Issue-
I'm trying to create a shop that consumes your mana and life for items, I got the hp and mp check down by using
"$gameParty.leader().mp >= 50" and "$gameParty.leader().hpRate() > 0.2" in conditional branches to check if the party leader has enough, but I can't figure out how to make it reduce mana or life. Is there a plugin for something like this because I can't figure out how to do it normally. I don't know very much about coding, so I might just be missing something. The end goal is to make an event that takes 50 of the party leaders mana (The actor that the player is currently controlling) and 20% of their hp as well.

List of Info-
Plugins->
all plugins 1.PNG
all plugins 2.PNG



What I've Tried-
To reduce the party leaders mp, I've tried putting "$gameParty.leader().mp -= 50" into a script command in the contents of the event, but nothing happens in game when activated.
Example of event.PNG
When trying to do this in a new project, it still doesn't do anything
Try this instead:
JavaScript:
$gameParty.leader().gainMp(-50);

gainMp(x) is the dedicated function for changing MP values.
That works thank you! Would you know how to reduce the party leaders hp by a percentage? Should I make a separate
Try this instead:
JavaScript:
$gameParty.leader().gainMp(-50);

gainMp(x) is the dedicated function for changing MP values.

That works thank you! Would you know how to reduce the party leaders hp by a percentage? Should I make a separate thread for this part?
Try $gameParty.leader().gainMP(-50)

Edit:
For the HP you can use gainHP respectively
@Aerosys I think you mistyped with a capital "P"

Would you know how to reduce the party leaders hp by a percentage?

Code:
$gameParty.leader().gainHp(Math.floor($gameParty.leader().mhp*-.2))
for twenty percent of their health.
@Aerosys I think you mistyped with a capital "P"



Code:
$gameParty.leader().gainHp(Math.floor($gameParty.leader().mhp*-.2))
for twenty percent of their health.
That works, thank you!

Original thread: https://forums.rpgmakerweb.com/threads/reducing-the-party-leaders-mp-by-a-set-number.154040/