So, just to clarify:
1)Create UnitStat_LightningWeakness in example_coreunitstats.xml, set to 1.
2)Add GameModifier to each 'metal' item which adjusts UnitStat_LightningWeakness by 10%:
<GameModifier InternalName="LightWeakAdjust">
<ModType>Unit</ModType>
<Attribute>AdjustUnitStat</Attribute>
<StrVal>UnitStat_LightningWeakness</StrVal>
<Value>10</Value>
<Operator>%<Operator>
</GameModifier
3)Then in the GameModifier "Damage" for spell "UltraMegaLightningSplosion" something like this:
<GameModifier InternalName="UMLSDamage">
<ModType>Unit</ModType>
<Attribute>CurHealth</Attribute>
<Calculate InternalName="AirShardBonus" ValueOwner="CastingUnit">
<Expression><![CDATA[[UnitStat_NumAirShards] * -5]]></Expression>
</Calculate>
<Calculate InternalName="LightningWeaknessBonus" ValueOwner="TargetUnit">
<Expression><![CDATA[[UnitStat_LightningWeakness] * -50]]></Expression>
</Calculate>
<Calculate InternalName="Value">
<Expression><![CDATA[[AirShardBonus] + [LightningWeaknessBonus]]]></Expression>
</Calculate>
</GameModifier>