There's no way to return the exact combat mode of units using the CombatMode command. It only works if you use setCombatMode, which will change combat mode for an entire group, not just individual units.
To set combat mode for individual units, the trick that mod-makers (and I'm assuming the vanilla commanding menus) use is this:
- Create a new group,
- Temporarily move the units to this new group,
- Set combat mode for the new group,
- Rejoin units back into their original group.
But this method breaks the combatMode command; which is (most likely) because it's associated with groups, not units.