Rather than defining effects in unit xmls could there instead be effect xmls?
When an effect is applied to a skill, as well as defining a new effect for just that unit, effects can work by referencing an xml:
For example, this would be valid:
<effects>
<effect name="per_unit_blindness_effect" bias="detrimental" stacking="extend" duration="5">
<multipliers>
<sight value="0.5"/>
<attack-range value="0.5"/>
</multipliers>
<flags/>
</effect>
<effect xml= "../../../../effects/shared_blindness_effect.xml"/>
</effects>
The effect XML could look like this:
<effect>
<name value="shared_blindness_effect"/>
<bias value="detrimental"/>
<stacking value="extend"/>
<duration value="5"/>
<multipliers>
<sight value="0.5"/>
<attack-range value="0.5"/>
</multipliers>
<flags/>
</effect>
It would make using effects a lot tidier, and will allow multiple units to use the same effects, even cross-faction. The location of the xmls isn't really important either. Per unit xmls could be kept for effects that are to be entirely unique to that one unit and for backwards compatibility.
Another interesting idea would be to mix effects with upgrades, where upgrades can apply permanent duration effects to units (effects applied by upgrades shouldn't appear in the units stats like how normal effects do though, for example if a unit has increased health from an upgrade effect it would be shown as if they had their health increased by an upgrade essentially making upgrade effects 'invisible' like normal upgrades).