If I understand your problem correctly, GetPartyMemberByIndex() is your help here. Function defines party member as object, but you don't have to give tag or anything, it'll work on whoever is party member at a time.
object oPC = GetPartyMemberByIndex(0);
object oNPC1 = GetPartyMemberByIndex(1);
object oNPC1 = GetPartyMemberByIndex(2);
The int parameter defines which party member it is; 0 is player character, 1 and 2 are other party members. Now only thing you need to figure out which one is 1 and which one is 2, but that shouldn't be too hard