Conditional Skill Effects, Buffs and Debuffs

So I'm trying to implement a few skills with debuffs within my project that only get applied if a certain status ailment or condition is present. I'm also hoping for these skills to be able to stack with the default RMMV debuffs (atk. down, def. down, etc), since they are conditional effects.

For example, one skill I've been trying to get to work has a X% (let's say, 50% in this case) to inflict blind, and if the enemy gets blinded, it applies a m.def down debuff.
Another skill is a cleanse skill, where if a certain status ailment is cured, it'll also recover an X amount of MP.

Anyone got any idea how this could work? Or is there a plugin out there that can do this (and it somehow went under my nose)?
its an easy setup with Yanfly's Skill core plugin. instead of applying the states and buffs from the skill effect, youd use the notebox and some script calls to make with your conditions.

(let's say, 50% in this case) to inflict blind, and if the enemy gets blinded, it applies a m.def down debuff.
Code:
<After Eval>
if (Math.random() < .5*target.stateRate(x)){ //replace the x's with blind's state ID
  target.addState(x);
  target.addDebuff(5,3);
}
</After Eval>

Another skill is a cleanse skill, where if a certain status ailment is cured, it'll also recover an X amount of MP.
Code:
<After Eval>
if (target.isStateAffected(x)){ //replace the x's with the state's ID
  target.removeState(x);
  target.gainMp(5);
}
</After Eval>
its an easy setup with Yanfly's Skill core plugin. instead of applying the states and buffs from the skill effect, youd use the notebox and some script calls to make with your conditions.


Code:
<After Eval>
if (Math.random() < .5*target.stateRate(x)){ //replace the x's with blind's state ID
  target.addState(x);
  target.addDebuff(5,3);
}
</After Eval>


Code:
<After Eval>
if (target.isStateAffected(x)){ //replace the x's with the state's ID
  target.removeState(x);
  target.gainMp(5);
}
</After Eval>
This is perfect! Just one question: for the "target.addDebuff(5,3)", how would i specify which debuff to apply? Is that what the numbers are for? (Like, one is the state id and the other is the # of turns?)

Other than that, this is exactly what I was looking for, thank you so much!
how would i specify which debuff to apply? Is that what the numbers are for? (Like, one is the state id and the other is the # of turns?)
as youve guessed, the first number is the parameter id for the debuff youre adding, and the second number is the turns.
im sure that the script call list has the ids listed somewhere, but if you look at the editor and count down the list starting from 0, you can see what number belongs to what parameter
1724636544851.png
This is perfect! Just one question: for the "target.addDebuff(5,3)", how would i specify which debuff to apply? Is that what the numbers are for? (Like, one is the state id and the other is the # of turns?)
Just to clarify, since I know we're going across languages.

RPG Maker uses the word "debuff" and "buff" in a specific way. These are not states with state IDs.

1724636518475.png


Did you want that? Or did you actually mean a state?
Just to clarify, since I know we're going across languages.

RPG Maker uses the word "debuff" and "buff" in a specific way. These are not states with state IDs.

View attachment 315909

Did you want that? Or did you actually mean a state?
I see the difference. I'm not too sure but I would assume a state, since I prefer this skill to stack with normal debuffs that I have other skills using.
Buffs and debuffs do stack, that's one way they are different from states.

Original thread: https://forums.rpgmakerweb.com/threads/conditional-skill-effects-buffs-and-debuffs.171408/