How to make Pokemon static and flame body abilities in RMMV?

When a Pokemon with this Ability is hit by a move, there is a 30% chance that the attacking Pokemon will become paralyzed.

Any idea how to make it happen in MV?
Use Yanfly's Buffs & States Core.

I believe the best way to implement it within this plugin would be as a <Custom Respond Effect> (or a <Custom React Effect>). I'm not sure of the exact syntax you'd want to use - I think it would be something like attacker.addState(x) where x is the ID of the state - but again, I'm not sure and you'll need to figure out what the correct syntax is for it to work properly.

Note that this kind of custom behavior is one of the more intricate uses of plugins, so if you've never worked with plugins before, I recommend putting effects like Static Body aside for now, and getting comfortable with some of the simpler plugins first.
Thanks! No worries. I use yanfly tip and tricks and have to customize them sometimes, so this one should not be too difficult.

Edit: I made some slight changes to JamesRyans' note tag. But the flame body state has 100% chance of burning. Is there any way to reduce this percentage?

258 is flame body, 17 is the burn state. I think I need something like an "if affected by state and if probabilty=0.3, then...." but i don't know how to put it there.

Spoiler: Notetag
<Custom Respond Effect>

//Check if user has State 1

if (target.isStateAffected(258)){

//Change X to your Poison state below. State is applied when damage is deal with 100% chance

user.addState(17);}

else{

//Make a random number for 20% chance when user does not have State 1

if (Math.random() < 0){

//Change X to your Poison state below

user.addState(17);}}

</Custom Respond Effect>

Edit2: Problem solved! For anyone interested in a flame body ability with a 30% chance.

Spoiler: flame body notetag
<Custom Respond Effect>

//Check if user has State 1

if (target.isStateAffected(258) && Math.random() < 0.3){

//Change X to your Poison state below. State is applied when damage is deal with 100% chance

user.addState(17);}

</Custom Respond Effect>
Looks good! Assuming that you are putting this Custom Respond Effect on the Flame Body state as a Custom Respond Effect, I don't think you should need to be checking whether the target has the Flame Body state ("target.isStateAffected(258)"), since the notetags won't even be looked at if this State isn't on the target in the first place. 🙂
Looks good! Assuming that you are putting this Custom Respond Effect on the Flame Body state as a Custom Respond Effect, I don't think you should need to be checking whether the target has the Flame Body state ("target.isStateAffected(258)"), since the notetags won't even be looked at if this State isn't on the target in the first place. 🙂

Thanks! Actually, I intend will use it as a passive state for the target.

Original thread: https://forums.rpgmakerweb.com/threads/how-to-make-pokemon-static-and-flame-body-abilities-in-rmmv.93917/