Track how long in party?

Is there anyway to keep track of how long a party member has been in your party and later use it in conditional branches?
Say like a traitor is in the party and this is determined by whoever is the least used party member.
I haven't tried it but Tutorial: Simple Relationship System did something like that.

Edit: Oops. Didn't notice this wasn't RMMV. I don't know how much work is needed to implement the same in VX Ace.

Original thread: https://forums.rpgmakerweb.com/threads/track-how-long-in-party.103674/