"Detonate" states?

What I mean with the title:

Enemy has state: "Oily"
You then use Fireball, which applies State: "Burning".
Burning 'detonates' the Oily state, meaning there's an animation played on the enemy, and the enemy takes damage. He also receives state Burning.
Preferably, this should all be handled with with the states themselves, so no matter which skill you use, as long as it applies Burning, it will detonate 'Oily'.

Is it possible to pull this off with with default MV, or do I need a plugin? I got YanFly's collection downloaded.
There's an Overriding States plugin from Hime which can handle Buring replacing Oily overriding, but I'm not sure how to set up the 'detonation'.
Yeah Yanfly Buff&States <Custom Apply Effect> on burning state checks if target has oily and plays animation and causes damage and removes oily state.

edit: so it would be like (you might want to add a line that checks if the target dies from the explosion)

<Custom Apply Effect>
if (target.isStateAffected(X)) {
target.startAnimation(Y);
target.gainHp(-Z);
target.removeState(X);
}
</Custom Apply Effect>
Yeah Yanfly Buff&States <Custom Apply Effect> on burning state checks if target has oily and plays animation and causes damage and removes oily state.

edit: so it would be like (you might want to add a line that checks if the target dies from the explosion)

<Custom Apply Effect>
if (target.isStateAffected(X)) {
target.startAnimation(Y);
target.gainHp(-Z);
target.removeState(X);
}
</Custom Apply Effect>
Thanks a bunch, will try it out when I got some free time!
edit: it worked 🙂

Original thread: https://forums.rpgmakerweb.com/threads/detonate-states.175199/