MV Differentiating Temporary Actors

I'm trying to add the functionality for Yanfly's Passive States to execute Custom Apply/Remove Effects when their conditions are met/failed. So far, it's working fine except when looking at equipment.

When you're in the equip scene and looking at a different item, the way the stat comparison is done is by making a copy of the actor, equipping the item to that actor, and showing the parameter differences. This includes activating any passive states on the item so that the comparison will be as accurate as possible.

Since the window (and I'm looking at Window_EquipStatus) starts by making a copy of the actor, if I were to check theState'sBattler==window._tempActor that won't help.

I then thought I'd just add an extra variable to the temp actor window._tempActor.isCopy=true but the function that applies passive states is looking at a Game_BattlerBase, so when I check if (!theState'sBattler.isCopy) it's always passing.

Can I add that temp variable to the parent class inside of the Window functions? It doesn't look like super() will let me do that, but is there a different way?

I suppose I could add an appropriate method, Game_BattlerBase.isCopy() and then use super() to call that from the Window function...? Any better thoughts?
Why not just compare the actor ID? 😅
Why not just compare the actor ID? 😅
Because when the temporary is made via:
var actor = JsonEx.makeDeepCopy(this._actor);
Won't the ID be the same, just like all other member variables?

And also because once I'm in the Yanfly state functions, it's only looking at one BattlerBase, so I don't know what the ID is "supposed" to be - there's nothing to compare to. I could add a line in the above method to set the ID to something absurd and specific, like 1000, and then check for that.

Edit: Just to clarify - between the time I wrote the post last night and checked the forums again this morning, I took the minute to add a setter method to BattlerBase and it all works. I was just wondering if there was some JS syntax I was unfamiliar with to do it in more of one step.

Original thread: https://forums.rpgmakerweb.com/threads/differentiating-temporary-actors.141721/