Party vs Formation

So. I'm trying to setup an ability, just a simple check to see if the party member is in your party then, if they are a Thief, then, if they have learned Trap Sense. That works without a hitch, but then I run into the issue, if they are in Party Reserve, the engine can't tell that they are not in Active Formation. How do I tell the game that the party member is not in party without technically removing them from the game? I should have to disable them from the party reserve just to accomplish this, right?

I hope some of you have encountered this and have some ideas. I'm spinning my wheels on this. After testing the game yesterday, I ran into a Mimic I forgot was in said dungeon and got my butt kicked pretty hard. It was a really fun fight, but realized, I should have a way of deflecting traps like that if you have a party member actively in your party formation. I know in Harem Collector, they have you select your party when leaving your home than cutting you off from the rest of your party member that way. I'm not 100% sure if that method is right for our game though. (also, I'm using MV if that's necessary.)

edit: It looks as though this is something to do with a Party plugin I'm using. I'll have to contact YanFly I think.
Supposing you want to check if actor 5 is in the main party, you could put this in the 'Script' box of a conditional branch:
JavaScript:
$gameParty.battleMembers().some(actor => actor.actorId() == 5)

*Edit* corrected a typo
Thankyou, I'll try that.

edit: That did infact fix it. Thankyou very much.
What engine is this for? This is really more of a support question and I’d love to get it moved to a better home. 🙂

Edit: Oh MV. Derp. I have moved this thread to RPG Maker MV Support. Thank you!
Here's a mod of Arthan's script to check if a party member has a skill. Just change x to the skill number
$gameParty.battleMembers().some(actor => actor.hasSkill(x))
What engine is this for? This is really more of a support question and I’d love to get it moved to a better home. 🙂

Edit: Oh MV. Derp. I have moved this thread to RPG Maker MV Support. Thank you!
Thankyou. I rarely use forums at all so I didn't know where to post asking for help.

Original thread: https://forums.rpgmakerweb.com/threads/party-vs-formation.158715/