MV Help with implementing elemental damage interaction

The bare basics of the game that I am working on makes use of different elements that all have different interactions. This is a chart for it:

chart elements.png


Enemies will have traits which will make them weak and strong against certain elements. That is something that I already know how to do. What I can't figure out for the life of me is this. I want elemental attacks to apply a state to the enemy. Each elemental state has a different element that deals double damage when hit based on the chart. The elemental state is then removed. For example if an enemy is hit by a fire attack, apply the fire state to it. Fire state makes the enemy take double damage from a wind damage dealing attack then the fire state is removed. The state removal as a whole is where I am stuck at. Plugins that I am using are all of Yanfly's that I could get for free.
All you need is the Buffs & States.

Code:
<Custom Respond Effect>
if (this.isDamage() && this.item().damage.elementId == 4) // replace 4 with the appropriate element ID
    target.removeState(stateId);
</Custom Respond Effect>
All you need is the Buffs & States.

Code:
<Custom Respond Effect>
if (this.isDamage() && this.item().damage.elementId == 4) // replace 4 with the appropriate element ID
    target.removeState(stateId);
</Custom Respond Effect>
Thank you so much! Everything is working as I want it to for now.

Original thread: https://forums.rpgmakerweb.com/threads/help-with-implementing-elemental-damage-interaction.169614/