Add a state when an enemy is hit by certain element

I would like to have an enemy that can get a certain state when it is being hit by a certain element, for example :
"Slime" monster will get the "Burn" state when attacked by fire elemental attacks.

Should I use plugin ?
Thanks for the help in advance.
Enemies don't get hit by elements. They get hit by skills or items. Just make the skill or item apply the state.
Additionally, if you don't want the fire elemental enemy to get the burn state, you could add state immunity to them.

But it is not compatible with the popular Yanfly Battle Core (idk if you use it)
True. I cannot use it because it's not compatible...
True. I cannot use it because it's not compatible...
Just add + b.addState() to your damage formula and it will add the state when the skill hits (put the state number in parenthesis).
with YanFly plugins it could work with a set of two differnt states.
first state, used as passive state on slime, activate on response. If condition is met, add the second state on slime.
second state correspond to your "burn" state and it does whatever you want.

But it is not compatible with the popular Yanfly Battle Core (idk if you use it)
You can achieve the same effects with Yanfly buff and states core using lunatic code.

But as far as adding a burn state whenever the target is hit by a fire element skill/attack, the best way has been suggested: using the b.addState(X) in the damage formula box of the skills using fire element, or adding the state with a percentage chance in the skills effects box.

Original thread: https://forums.rpgmakerweb.com/threads/add-a-state-when-an-enemy-is-hit-by-certain-element.120300/