However, I estimate that I may have as many as 150 provinces on the map, which means I've eaten up about 900-1000 preplaced units. Because I'm using EUD's, my unit limits are original
Hmm, I don't quite follow why you
need EUDs to accomplish your spawn system where each building can be upgraded.
I think the best approach to creating anything is
Occam's Razor--use the simplest solution first and then only add complexity when you can't solve it (or efficiently solve it that way).
Following that, have you looked into solving this problem without EUDs? Is your problem not solvable without EUDs, or is it "too slow" without them? While EUDs are powerful and cool, we have to avoid the situation where we have a real nice hammer (EUD) and trying to find any nail to use it on (your spawn/upgrade system). And another overhead--even if you get EUD to work, how comfortable are you debugging or maintaining your system? If you're going to need to make a post every time there's a problem, your map won't be maintainable in the long run and your project will stagnate.
Here's my understanding of your system:
1. There are Duchies--Cyber Cores, where each one is a potentially unit spawner on the map.
2. Each cyber core has spawn levels. Depending on the level of the Duchy, different units will spawn from it.
3. You currently use the health on the cyber core to store its current level (1-4?) using decimal places (very hacky).
4. You can upgrade each cyber core (how is this done?)
Here's one solution without EUDs (there are many depending on what units, etc. you need in your map).
1. Count each cyber core by giving 1 cyber core to a neutral player at a time centering a spawn location on it, and then doing whatever (e.g. create units there)
2. Return all cyber cores to the player whose turn it was to spawn, and then continue for each remaining player. With hyper triggers this will be very quick.
3. To determine spawn level at a particular cyber core, there are several options:
a. Create an invincible burrowed neutral unit at the cyber core. Use these to determine the spawn level, e.g. if Neutral brings exactly 2 zerglings to the current cyber core, then you know the spawn level is 2. Other variants include powerups (if you have no workers). You also could create a little rectangular box where powerups are stored right next to the cyber core to indicate spawn level (so that workers can't pick them up), e.g. each psi emitter = 1 level of spawn. The advantage of this is the players now have a an onscreen UI to visually see the spawn level, rather than look at cyber core HP.
b. Iterate over each cyber core in a single loop, regardless of player turns. In a separate area of the map, use another unit, e.g. powerup or unused ground neutral unit, where you also count this. In this "double" counting, you count the units in the 2nd area to determine the spawn level. This is almost the same as above, except a bit more complicated and requires allocating terrain to store spawn levels data for each Duchy/cyber core.
4. How to upgrade each cyber core?
a. Have a unit that when brought to a cyber core can upgrade it for a certain cost.
b. Same as above, but trigger this by building a unit from a gateway/stargate, etc. to avoid accidentally upgrading a Duchy.
c. Use refineries stacked on each other, so a worker makes a refinery to upgrade it.
b. Build a particular building next to the Duchy, e.g. pylon, missile turret, etc. You can remove the building after it finishes and store the upgrade using ways I outlined in 3.
None.