To get their combat mode (engage at will, fire at will and so forth), use this:
(combatMode (group unit) == "MODE")Where "MODE" is one of the following:
"BLUE", Never fire, never engage
"GREEN", Fire at will, never engage
"YELLOW", Never fire, engage at will
"RED", Fire at will, Engage at will
If you want to check for their behaviour (careless, safe, aware, combat, stealth), use this:
(behaviour unit == "BEHAVIOUR")Where "BEHAVIOUR" is one of the following:
"CARELESS"
"SAFE"
"AWARE"
"COMBAT"
"STEALTH"
I hope that helps.