[MV] enemies blowing up?

So I wanted to include barrel mimics (the barrels are powder kegs), and if they're hit by fire-type damaging abilities, they explode (and die in the process), damaging it's allies and enemies, how do I do this?
I might be wrong but you could always try and set it up as an ability, activated only when someone in your party (If that's what you want) uses a fire-type attack/spell that then causes them to "attack", like say self-destruct in Pokemon, that hurts everyone and kills the user.

Not sure if there's a way to make abilities hit everyone, but I haven't explored those possibilities yet.

I've moved this thread to MV Support. Thank you.

Moved to: MV Support

Sorry, also is what I mentioned possible to pull off?
I know it's possible to do it part thx to yanfly, just don't add the elemento absorb note tag

http://yanfly.moe/2016/12/14/tips-tricks-overheat-rpg-maker-mv/
I know it's possible to do it part thx to yanfly, just don't add the elemento absorb note tag

http://yanfly.moe/2016/12/14/tips-tricks-overheat-rpg-maker-mv/

How do I change it to just explode when hit by fire then? just remove that one tag and it should do that?

EDIT: I followed everything it said to do and nothing happened, the enemy just died, and no explosion.

EDIT 2: welp now it's making SV_Actor enemies facing away from the player characters, this scripting is becoming a HUGE pain. (managed to fix that, for some reason the sprite sheet was flipped the wrong way, go figure)
Try this code on your "Unstable" passive state.
Code:
<Custom React Effect>
if (this.isHpEffect()) {
  var fireElementId = x;
  var elements = this.getItemElements();
  if (elements.contains(fireElementId)) {
    var dmg = <DAMAGE FORMULA HERE>;
    target.startAnimation(107);
    target.setHp(0);
    var members = user.friendsUnit().aliveMembers().concat(target.friendsUnit().aliveMembers());
    for (var i = 0; i < members.length; ++i) {  
      var member = members[i];
      if (member) {
        member.gainHp(-1 * dmg * member.elementRate(fireElementId));
        member.startDamagePopup();
        if (member.isDead()) {
          member.performCollapse();
        }
        member.clearResult();
      }
    BattleManager.actionWaitForAnimation();
    }
  }
}
</Custom React Effect>

This will make an enemy affected by this state to explode and die when hit with fire, damaging every other unit on the battlefield with fire.
Just change the x at the beginning of the code with ID of your fire element, and replace the <DAMAGE FORMULA HERE> tag to change the damage the units will recieve (you can use stuff like "user.mat * 4" and such).
Try this code on your "Unstable" passive state.
Code:
<Custom React Effect>
if (this.isHpEffect()) {
  var fireElementId = x;
  var elements = this.getItemElements();
  if (elements.contains(fireElementId)) {
    var dmg = <DAMAGE FORMULA HERE>;
    target.startAnimation(107);
    target.setHp(0);
    var members = user.friendsUnit().aliveMembers().concat(target.friendsUnit().aliveMembers());
    for (var i = 0; i < members.length; ++i) {
      var member = members[i];
      if (member) {
        member.gainHp(-1 * dmg * member.elementRate(fireElementId));
        member.startDamagePopup();
        if (member.isDead()) {
          member.performCollapse();
        }
        member.clearResult();
      }
    BattleManager.actionWaitForAnimation();
    }
  }
}
</Custom React Effect>

This will make an enemy affected by this state to explode and die when hit with fire, damaging every other unit on the battlefield with fire.
Just change the x at the beginning of the code with ID of your fire element, and replace the <DAMAGE FORMULA HERE> tag to change the damage the units will recieve (you can use stuff like "user.mat * 4" and such).

Just put in the states note I assume?

EDIT: it did not explode and just took damage normally, idk what's going on.
Yes, that^ code goes on your passive state's notebox.
Be sure you're giving this passive state to your enemy using Yanfly's Auto Passive State plugin.
And be sure to have Yanfly's Buff & States plugin also.

It works, if it doesnt, you either don't have the plugins correctly installed or didn't change the code accordingly.
Yes, that^ code goes on your passive state's notebox.
Be sure you're giving this passive state to your enemy using Yanfly's Auto Passive State plugin.
And be sure to have Yanfly's Buff & States plugin also.

It works, if it doesnt, you either don't have the plugins correctly installed or didn't change the code accordingly.

I changed it as you said and the plugins are installed properly, idk what more to say

Original thread: https://forums.rpgmakerweb.com/threads/mv-enemies-blowing-up.88573/