A_CheckFlag
From ZDoom Wiki
A_CheckFlag(string flagname, state label, int check_pointer = AAPTR_DEFAULT);
Checks if the actor designated by the given actor pointer has the flag of this name, and if it is valid. If the pointer does not have the flag, no jump is performed.
Example
If this Imp's master is frightened this imp will be frightened too
actor CowardImp : DoomImp { States { See: TROO A 0 A_CheckFlag("FRIGHTENED", "RunAway", AAPTR_MASTER) TROO AABBCCDD 3 A_Chase loop RunAway: TROO A 0 A_ChangeFlag("FRIGHTENED", 1) Goto See+2 } }