If I'm understanding correctly, all you need to do is remove the actor from the party via eventing and add them back in when you're ready.
Yanfly's code assumes that all actors are travelling with the party.
If you want one actor to stay at a tavern, then it isn't in the party and should be removed from the party as the poster above said.
what you need to do when you gain the ability to add a new actor to the party is to not add them, but to enable them for the tavern map instead.
There are several ways how a tavern map can then handle that.
You'll have a map of the tavern, with one event for every possible party member.
Each of these events have at least three event pages for the three possible options of each member: unknown, in party and in tavern.
You might make more pages to enable different "conversations" with that actor.
The event condition "actor exists" means that the actor is in the party - which means that this page does not have a sprite and no content, the actor is not in the tavern if he is in the party.
"in tavern" is the page that displays the sprite, and if activated asks the player if he wants that actor to join - if yes the change member command is used to add that actor to the party.
And somewhere in the tavern you have a registry where you can rent a room for party members (which will remove them from the party by change member command)
Then no way to hide reserve party members from menu? the only solution is kick (really) them from party?
In that case I cant benefict from Yanflys plugin for party management, cause dont have reserve members...
You misinterpreted the basic definitions.
A "Party" is that what travels with the player/main actors. If you do not want someone to travel with (and be accessable for) the player, then that actor must not be in the party. And reserve members are still party members, they just don't participate in battle.
And yanfly's Plugin is a "Party Manager", it will not handle actors that are outside the party - and as long as someone is with the party, that actor will be accessable from the menues.
You have to remove an actor from the party to remove that actor from the status menu, and as soon as you remove someone from the party then that someone is also removed from yanfly's party menu, exactly because it is a party manager and not a tavern manager.
You can either use a tavern map and events to handle that, or you can request a new plugin "tavern manager" (because I don't know of an existing plugin that does this).
You cannot use the "party manager" as an replacement for a "tavern manager", because the basic concepts are different.
Basically you'd remove any reserve members from the party entirely if they're not in the current battle party, and then add all members back to the party before opening the tavern menu.
$gameParty.battleMembers() shows a list of all members in your battle party. Find a way to check that against $game.Party.members() which contains ALL party members (including reserves) and removes them from the party if they're not in the battle party.