It is very possible to do this. This system will require at most 3 dummies for each player using this system.
First off, look at for example the human main structure "Castle" in object editor. Look at the "Techtree - Requirements" field. You will see it requires "Altar of Kings". That's exactly the requirement that is needed for you to build/upgrade to that building.
It will be similar for your own buildings that you want to change.
Now, make 3 dummy units (or less, depends on how many tiers you want). Name one "No Upkeep", another "Low Upkeep" and last "High Upkeep".
These units won't do anything in the game, they should be untargetable (= have locust), have no model, no sound, etc. - all a dummy unit should have.
Make these 3 dummies as requirements for your buildings that should require them (just like with "Altar of Kings" for Castle unit) - a unit that requires "No Upkeep" should have dummy unit "No Upkeep" in requirements, etc.
When game starts, create one of each dummy unit and save them into variable. E.g. something like this:
-
Actions
-
Unit - Create 1 No Upkeep for Player 1 (Red) at loc facing Default building facing degrees
-
Set No_Upkeep = (Last created unit)
-
Unit - Create 1 Low Upkeep for Player 1 (Red) at loc facing Default building facing degrees
-
Set Low_Upkeep = (Last created unit)
-
Unit - Create 1 High Upkeep for Player 1 (Red) at loc facing Default building facing degrees
-
Set High_Upkeep = (Last created unit)
And last, when unit enters map - and it's something that takes your food, you check the food amount for that player. Then you change owner of those 3 dummies - the one dummy who corresponds to current Upkeep level will be owned by that player, while the rest will be owned by Neutral Passive.
You will need to constantly change the ownership like this.
What it will do is: when the dummy (e.g. High_Upkeep) is owned by Neutral Passive, every building of player X will have their buildings with "High Upkeep" requirement grayed out with text "Requires: High Upkeep". (note - the High Upkeep in this text is actually the name of the dummy unit)