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:
<effect name="per_unit_blindness_effect" bias="detrimental" stacking="extend" duration="5">
<effect xml= "../../../../effects/shared_blindness_effect.xml"/>
The effect XML could look like this:
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).