the variable needs to contain the ID of the actor you want as a target.
and in this specific case, that is very easy to do.
use control variable : Game Data : Party Member #3 to get the ID of the actor in third party position, then use that variable in the change state command for the actor.
you are completely right about this.
There are possible workarounds, but unfortunately you haven't given enough information to choose which workaround would be usable as they all have restrictions.
For example the most common workaround for the conditional branch is to make one conditional branch for each actor, placing the commands if that actor has the state in that branch. if an actor doesn't have the state it gets skipped, allowing multiple possibles to be processed one after another.
However that makes for rather long events if you have a lot of actors. So another option is to use scripts to extract the required IDs to variables, but that is more complex and only used if you have a lot of actors.