For physical damage, this is not a problem - the Dragonhide spell perk provides a good template, and under "Attacker" tab I just add various keywords for actor types whose damage I want reduced.
For magical damage however, I am having a problem. I choose "Mod Incoming spell Magnitude" and under "Spell" tab add the same keyword conditions as I did for the physical damage part (hasKeyword ActorTypeUndead, hasKeyword ActorTypeDaedra, etc). I tried running these conditions on Target and on Subject, but neither produced any effect. If I take the conditions out, the entry point works (so this seems to be the correct entry point), I just need to restrict the damage reduction to spells cast by certain actor types.