On-hit effects for armors...

Hello!
I'm looking to do spell and item armors that will cause states when they are attacked (ex. fire armor will cause burn effect with x% when attacked with a physical attack). How can I make this happen?
Thank you in advance!
Note: I have access to all of YanFly's plugins, so if that's a option, I'm open to it - but I do not want to have to write a plugin myself. I have some JS background and skills, but I'm not "fluent".
Use buffs & states core along with auto passive states. Give the armour a passive state with a custom react effect that does target.addState(id of burn);
Use buffs & states core along with auto passive states. Give the armour a passive state with a custom react effect that does target.addState(id of burn);
So the state procs on the armor (thank you!!), but I would like for it to only happen on physical attacks. I tried this, but it didn't work:
Code:
<Custom React Effect>
if(a.isElement(01)){a.addState(12)}
</Custom React Effect>
Edit: Also, how would I make this only inflict burn x% of the time?
Code:
<Custom React Effect>
if (this.isPhysical()) {
  let rand = Math.randomInt(100);
  if (rand < 15) {
    user.addState(4);
  }
}
</Custom React Effect>

Where 15 is the % chance you want of inflicting it, and 4 is the ID of your burn state.
Moving this thread to JS Plugin Support, since there's no reasonable way to do this without Plugins (even though there should be!).
Code:
<Custom React Effect>
if (this.isPhysical()) {
  let rand = Math.randomInt(100);
  if (rand < 15) {
    user.addState(4);
  }
}
</Custom React Effect>

Where 15 is the % chance you want of inflicting it, and 4 is the ID of your burn state.
Thank you so much!!! Everything worked well once I remembered to change my element name back to Physical (was Physical Melee, lol). Your help has been so appreciated!

This thread is being closed, due to being solved. If for some reason you would like this thread re-opened, please report this post and leave a message why. Thank you.

Original thread: https://forums.rpgmakerweb.com/threads/on-hit-effects-for-armors.124607/