You can’t add new operations, as those are links to the game engine. You use the API that is given to you.
Check operations that can retrieve or check for flags in troops. If what you want is not there, then add your custom code. You can use slots or just a simple range/unit check like: if troop #3, #45 or #99 then do this.
if you need further help just add to this thread.
and get Lav’s modsys and use his header_operations as it has better documentation