Auto Battle Actors

I want to create a kind-of-rows-system, where the 4th and 5th actor of the group are controlled by the AI.

I started creating the state with the autobattleflag, but I can't think of an efficient way to give the state to the actor, since you are allowed to change the party order and the ID of the 4th and 5th actor changes over time. Maybe somebody knows a way or a function of a plugin that would make it easier and more efficient, because I don't want to let the game check the actors ID's and store it to variables every second.

Also, I'm using Yanfly's Party System.

Thanks for help or advice in advance.
Do you want specific actors to act on their own accord all the time?

Because there is a feature for this. Under the actor tap double click the features block.

Go to the "other"-tab and select "auto-fight". (Names might be different as my version is still set to german 😀 )

or  is it supposed to be the 4th and 5th?
I'm german as well 😀

Yes I know of the features and I also implemented it. But I want to let the 4th and 5th actor in the party (not in the database) battle on their own, to add a little bit more tactics and to speed up the fights, since you don't have to choose an action for all 5 battlers. But the order of the actor changes over time, so I can't go with the auto-battle-flag in the actors database. I created a state that gives them "auto-battle", but I'm just not sure if it's efficient to let the game check the positions of the actors and store them to variables all the time.
$gameParty.members()[X].addState(Y);

$gameParty.members()[X].removeState(Y);

X is member number in fight ( start from 0 )

Y is state with auto fight
$gameParty.members()[X].addState(Y);

$gameParty.members()[X].removeState(Y);

X is member number in fight ( start from 0 )

Y is state with auto fight
Okay thanks, I'll try it out.

Original thread: https://forums.rpgmakerweb.com/threads/auto-battle-actors.52346/