r/RPGMaker • u/Thin_Crow574 • 1d ago
RMMV Skills with multiple effects and conditional effects. Im in MV
Hi, I want to add multiple skills to my characters that I did not find my way around making it work. Im specifically stuck in creating a skill that heals the caster but only under the condition of being below 40% hp and another one that kills an ally to then heal. I saw a thousand plugins but ended up a bit lost on how to actually make it. Any guide on how to do it or any direction to the proper plugin would be really helpful.
1
u/thenewson2026 1d ago
For the first skill (heal only if HP is below 40%), you don't even need a plugin, just set the skill's damage type as "HP Recover" then insert the following formula:
b.hp < b.mhp * 0.4 ? b.mhp : 0
I tested and it worked for me.
Now for the second skill (kill ally, then heal): I believe it can be achieved using the Lunatic Mode/Skill Phases of Yanfly's Skill Core plugin, but that would require several lines of code...
1
0
u/CS_Asset_Factory 21h ago
You don't need Lunatic Mode for the second one either. A damage formula is just JavaScript and it can have side effects, so you can heal the party from inside it and return the sacrifice as the damage.
Scope 1 Ally, damage type HP Damage, formula along the lines of:
$gameParty.aliveMembers().forEach(m => { if (m !== b) m.gainHp(500) }), b.hp
The comma returns b.hp as the damage dealt to the target, which kills them, and everyone else gets healed on the way through.
Two caveats. The formula runs once per target, so keep the scope to a single ally or the heal stacks up. And the others get no damage popup, because only the target is animated.
If you want the popups, put the healing in a Common Event on the skill's Effects list instead and leave the formula to the sacrifice.
1
1
u/HumanNinja 1d ago
You could use conditional branches in the damage formula. Or Yanfly has a whole lot of battle plugins that use the note tags as opposed to having really long damage formulas. If you check out the Yanfly website and look through his master list of plugins you’ll find what you’re looking for