Substitute Trait

Hi! Hopefully this has an easy answer.

I want to use the substitute trait and it works great! Except, if the enemy is attacking everyone, the one with the substitute trait will cover everyone that's reached the hp threshold. That seems a little broken.
Is there a way to prevent it from firing off if the attack is aimed at everyone?
Assuming you're not using any plugins that overwrite or change it, you can achieve this by changing line 2548 of rpg_managers.js to

Code:
var realTarget = !this._action.isForAll() ? this.applySubstitute(target) : target;
Thanks! That did it!

Original thread: https://forums.rpgmakerweb.com/threads/substitute-trait.124289/