adding states after final attack

Using Yanfly's Battle Engine, Sequences, and buff and states plugin.  Is there a way to have a skill apply a state at lets say .2 (or 20%) of the time to enemy target after skill is compete.  I can get it so it will always add after an attack effect with...I don't want it to always apply.


action effect


wait: 5


add state 28: target


the problem is  my skill is a muti hit skill and if I do pre-damage or post damage eval in the sequence the state will sometimes apply before skill is done and the state will trigger pre-maturely.


thank-you.
If you are not using the 'Repeat' field (i.e. set to 1) and using the action sequence to do your multi hit, you can do the add state by chance in follow action tags right before finish action.


<finish action>


if (Math.randomInt(99) < 20)


  add state 28: target


end


</finish action>


Hope that answers your question!


- Riff
Thank you for the reply.  I changed the 20 to a higher number and lower to see if would apply  The state isn't applying yet.  Not sure if another plug in is interfering. 


after a little testing I found out why it wasn't working....Wasn't working when I copied and pasted your example into to the sequence so for S and Giggles, I put an else of move user:  home.  (which at this point already was but just put something there incase the if statement was false).


Now seems to work perfectly.  Thank you again for the reply... a second set of eyes is very helpful especially if you are to involved with something.

Original thread: https://forums.rpgmakerweb.com/threads/adding-states-after-final-attack.59135/