Making a boss not target a party member

So, for a boss fight, I'd like to make the boss refuse to target a certain party member unless all the others are dead. Let's say the party consists of Bob, Joe, and Tim. The boss likes Tim, and promises to kill him last. How would I make the boss not target Tim unless Bob and Joe are both dead?
if there are no other enemies there, then make a state that sets target rate to 0% and have it applied to Tim at the beginning of the combat. That will make that actor untargetable by all enemies in that battle.


If there are other enemies that should be able to attack the actor, you'll need a script for finer control.

Original thread: https://forums.rpgmakerweb.com/threads/making-a-boss-not-target-a-party-member.62935/