This actually brings up a good point, Hooman. Yes, I was kind of assuming this was a co-op game (though looking at the code Vagabond posted he uses -1 as well for his other triggers so maybe my assumption isn't that far off). However, it's a little-known fact that OP2 doesn't handle mid-game failure in multiplayer very well. If one person triggers a failure condition, the game ends like normal for them... but their defeat doesn't get sent across the network, so for all other players in the game it's treated as if the defeated player's connection was suddenly terminated.
In layman's terms, if you fail one player, the other 3 players get a "lost contact with player X" popup that they have to deal with. It's jarring, to say the least.
Regarding a custom trigger library, I like the idea, but question how useful it would actually be. I feel like the triggers OP2 provides usually are enough, and if I ever have to do anything "custom" it's usually pretty far out there. The only exception I can think of is "a specific unit dies", which is a reasonable enough thing to look for and kind of surprising there's no existing trigger for that.