enemy untargetable in combat

Hello, my friends!

I have a boss battle, and we have a weak boss and a force-feild protected henchman.

I want to:
1. Make the henchman untargetable at all (it is important because I use common events for damage, not base formulas) - you cannot attack him but he can attack you and put a statuses on himself too.
2. If the boss dies - henchman dies too and battle ends in victory.

Can you help me on implementstion of these two things please?
I made a little plugin to do this, but I'm failing at finding it 😛

@SGHarlekin might have it handy.

Worst case, I could do it again, but I'd rather not duplicate effort.
Code:
Game_Troop.prototype.isAllDead = function() {
    return this.aliveMembers().filter(enemy => !enemy.enemy().meta.doesntcount).length == 0
};

Save as ,js use as plugin, use enemy notetag:

<doesntcount>

So they don't count towards troop members.
As for untargetable, that's a yanfly plugin iirc.
Thanks a lot!
For not being able to target them, add this into the plugin.

Code:
var old_targetsForAlive = Game_Action.prototype.targetsForAlive;
Game_Action.prototype.targetsForAlive = function(unit)
{
    let targets = old_targetsForAlive.call(this, unit);
    if (unit == $gameTroop)
        targets = targets.filter(enemy =>  !enemy.enemy().meta.doesntcount);
    return targets;
};
Thank you! You are the best!
For not being able to target them, add this into the plugin.

Code:
var old_targetsForAlive = Game_Action.prototype.targetsForAlive;
Game_Action.prototype.targetsForAlive = function(unit)
{
    let targets = old_targetsForAlive.call(this, unit);
    if (unit == $gameTroop)
        targets = targets.filter(enemy =>  !enemy.enemy().meta.doesntcount);
    return targets;
};
This is very useful but what about a situation where if an enemy is affected with a state let's say taunt you can't target any other enemy.

Or if an enemy is affected with another state let's say cover you can't target it at all.
This is very useful but what about a situation where if an enemy is affected with a state let's say taunt you can't target any other enemy.

Or if an enemy is affected with another state let's say cover you can't target it at all.
Then that is not relevant to the OP's request.

Your profile says you use MV, so you should look at Yanfly's Taunt plugin, it has detailed settings to let you manipulate that behavior.

The cover part you could incorporate into the code I provided, checking for a state; but you could just as easily use Taunt (put taunt on all enemies except that one) or Yanfly's Selection Control.

Original thread: https://forums.rpgmakerweb.com/threads/enemy-untargetable-in-combat.169873/