MV trying to make an attack have a chance to increase state infliction (anyone got any ideas?)

for synergy reasons i was to make a skill that does the attacking but has a chance (not gurranteed) but a chance to extend the duration of a state infliction that an enemy has, let's say for example an enemy is inflicted with poison you pop out an attack that has a 50% chance to extend the duration once the attack lands how do i achieve that?
let's say for example an enemy is inflicted with poison you pop out an attack that has a 50% chance to extend the duration once the attack lands how do i achieve that?
youre already using yanfly's buffs & states and the skill core, so pick a skill tag, use this, and replace the "x"s
Code:
if (Math.random() <.5)
  target.setStateTurns(x, target.stateTurns(x)+1);
youre already using yanfly's buffs & states and the skill core, so pick a skill tag, use this, and replace the "x"s
Code:
if (Math.random() <.5)
  target.setStateTurns(x, target.stateTurns(x)+1);
thanks it works, just one more other question do i have to write this again for another state or i could add multiple state ids in the same single code
thanks it works, just one more other question do i have to write this again for another state or i could add multiple state ids in the same single code
depends on how you want it to work. if you copy the entire thing and paste it again, but change the ID, itll work, but itll do a separate roll for both states. you can end up only extending one state, but not the other.

if you want it to be all or nothing, you can add braces to the conditional statement and an extra line for each state.
Code:
if (Math.random() <.5){
  target.setStateTurns(x, target.stateTurns(x)+1);
  target.setStateTurns(y, target.stateTurns(y)+1);
}
depends on how you want it to work. if you copy the entire thing and paste it again, but change the ID, itll work, but itll do a separate roll for both states. you can end up only extending one state, but not the other.

if you want it to be all or nothing, you can add braces to the conditional statement and an extra line for each state.
Code:
if (Math.random() <.5){
  target.setStateTurns(x, target.stateTurns(x)+1);
  target.setStateTurns(y, target.stateTurns(y)+1);
}
is there a way for base paramater debuffs ?
is there a way for base paramater debuffs ?
yes, and that one doesnt need a plugin. so you can find it in the script call list if you search for debuff
thanks again

Original thread: https://forums.rpgmakerweb.com/threads/trying-to-make-an-attack-have-a-chance-to-increase-state-infliction-anyone-got-any-ideas.171538/