Skill Cost String Codes for requiring >= 75MP but costing 100MP

I'm using Yanfly's Skill Cost Manager http://yanflychannel.wordpress.com/rmvxa/gameplay-scripts/skill-cost-manager/

Although these strings should just use the general logic of RGSS3 and so even if you don't know that script you might know how to help.

I make it so the skill requirement string was 

mp >= 75

Which worked, as when the user's MP was 50, they couldn't use the spell,

but then I tried for the skill cost requirement string

custom cost perform
100 mp
/custom cost perform


and

custom cost perform

mp == 100
/custom cost perform


and etc but it didn't cost a think when used. 

Not when MP was less than 100, equal to 100, or greater than 100.

[Ramble]

If a spell requires 20 MP and you only have 19 MP, the spell will still be used, but, of course, your MP will drop to zero. If the user has 75% (for my game, but perhaps any set number in the script) of the MP that a spell costs, then the spell will be used and their MP will be depleted, or however you like to think it.

This feature is useful in other games where a 1 MP difference or so can get very frustrating.

For my game, an undercost is good to deepen gameplay because when MP is zero, the caster gets a Mortal state, where they take 100% critical hits aka their Magic Protection is no longer there to protect them from mortal blows so not only is their life force damaged from attacks but they have chances to say receive burns, get frozen, poisoned, or bleed. The critical evasion rate is, of course, raised by guarding and armor. So you have to determine if the spell is really needed. But without the undercost script, you're hardly ever going to see MP actually drop to "zero-zero" just because you need exact numbers.
custom cost perform is for specifying what happens when you use the skill... it's basically for reducing what needs to be reduced...


like if you want a 75 mp skill (though why would you use the script for this when you can just use the default methods?)


you would do


<custom cost requirement>


a.mp >= 75


</custom cost requirement>


<custom cost perform>


a.mp -= 75


</custom cost perform>


and yes, the arrow like thingies are needed


What did I do?


on the requirement part, we specify that the skill cannot be used if mp is < 75


then on the perform part (which runs after the skill is used), we tell it to reduce mp by 75...


Yanfly's scripts have a nicely written how to on the script pages themselves, you should really read it first and understand...
I found out how to do it, I just didn't know how to cost MP at first. I had to look on the comments to find -= meaning to subtract

Original thread: https://forums.rpgmakerweb.com/threads/skill-cost-string-codes-for-requiring-75mp-but-costing-100mp.22318/