EDIT: Actually the first one doesn't work properly, as it does extra damage to non-undead units.
Would this work for the MeleeAppliesSpell?
<GameModifier>
<ModType>Unit</ModType>
<Attribute>DefendableDamage</Attribute>
<AttackStat>UnitStat_Attack_Lightning</AttackStat>
<Calculate InternalName="Calc" ValueOwner="TargetUnit">
<Expression><![CDATA[[UnitStat_BG_IsUndead]]></Expression>
<Calculate InternalName="Calc2" ValueOwner="CastingUnit">
<Expression><![CDATA[[UnitStat_BG_IsUndead]]></Expression>
<Calculate InternalName="Calc3" ValueOwner="TargetUnit">
<Expression><![CDATA[[Calc2]] > [CDATA[Calc]]]></Expression>
<Calculate InternalName="Value">
<Expression><![CDATA[[Calc3] * 8]></Expression>
</Calculate>
</GameModifier>
It sometimes seems to do more than 8 Damage though, with no known resistances or weaknesses to Lightning.
Would this work?
<GameModifier>
<ModType>Unit</ModType>
<Attribute>DefendableDamage</Attribute>
<AttackStat>UnitStat_Attack_Lightning</AttackStat>
<Calculate InternalName="Calc" ValueOwner="TargetUnit">
<Expression><![CDATA[[UnitStat_BG_IsUndead]]></Expression>
<Calculate InternalName="Value">
<Expression><8></Expression>
</Calculate>
<vsHigher>1</vsHigher>
</GameModifier>
Or is the <vsHigher> only for use when you don't do any calculations?