Is it possible to create an armour which replaces skill cost from MP to hp. I'm using Yanfly's skill core and i want it so that the person with it equipped has there skills changed to a HP cost.
www.yanfly.moe
Is it possible to create an armour which replaces skill cost from mp to hp
RPG Maker MV SupportOne way I will show will still require the Actor to have the MP required to pay the cost to begin with (Which means they would likely go to 0 HP if they can't afford the cost and therefore die).
A simple way to make this work is with a passive state applied to the actor who is wearing the armor (If the armor is an independent item).
This notetag should go into any skills that the actor can cast.
If you don't use/have YEP_PassiveStates and don't have independent items, you can replace the
3 is the default slot of Body Armor in the equips slots as seen here.
Subtract by 1 for each Equipment Type to get the correct slot in code.

If you don't use Passive States and do use Independent Items, you should instead search for the name of the armor using
Another way to modify this would be to make a plugin which replaces the function and overwrites the cost of a skill before it is selected to prevent the potential issue I mentioned (that you can zero out HP and die while casting the skill)
A simple way to make this work is with a passive state applied to the actor who is wearing the armor (If the armor is an independent item).
This notetag should go into any skills that the actor can cast.
Code:
<Custom Execution>
//Custom execution runs as soon as the skill is initiatied.
// Check if the user has the passive state assigned by wearing the armor.
if (user.isStateAffected(ARMOR_STATE)) {
// Make the HP cost what the skill's MP cost was.
var hpCost = this.item().mpCost;
// Refund the user's MP
user.gainMp(hpCost);
// Take away the user's HP equal to the MP cost
user.gainHP(hpCost -1)
}
</Custom Execution>
If you don't use/have YEP_PassiveStates and don't have independent items, you can replace the
user.isStateAffected(ARMOR_STATE) with this instead:
Code:
user.equips()[3].id === DATABASE_ID_OF_ARMOR
3 is the default slot of Body Armor in the equips slots as seen here.
Subtract by 1 for each Equipment Type to get the correct slot in code.

If you don't use Passive States and do use Independent Items, you should instead search for the name of the armor using
user.equips()[3].name === "NAME OF ARMOR"Another way to modify this would be to make a plugin which replaces the function and overwrites the cost of a skill before it is selected to prevent the potential issue I mentioned (that you can zero out HP and die while casting the skill)
You don't necessarily need to make a new plugin for that. You can use Yanfly's Skill Core - let's say the skill should cost 25 MP and the armor has passive state 7.
Code:
<Custom MP Cost>
cost = user.isStateAffected(7) ? 0 : 25;
</Custom MP Cost>
<Custom HP Cost>
cost = user.isStateAffected(7) ? 25 : 0;
</Custom HP Cost>
The downside of this is you need to copy and paste and adjust the numbers for every possibly usable skill. The upside is you already have the necessary plugins so you don't need to request or commission anything from someone else.
I looked at these and considered they'd not work the way I thought. Good idea!
Original thread: https://forums.rpgmakerweb.com/threads/is-it-possible-to-create-an-armour-which-replaces-skill-cost-from-mp-to-hp.156730/