Well the coded/triggered methods have already been explained or at least mentioned I am pretty sure...
So here's a object editor only method to bypass magic immunity:
Go to the ability you want to bypass magic immunity.
Find the "Stats - Hero Ability" and set it to true.
Find the "Stats - Required Level" and set it to 6.
Find the "Stats - Hero Ability" and set it to false.
(Optional) = Air, Ground, Friend, Invulernable, Vulnerable