Get_Design_Ability will probably only work for the pre-set abilites like Point - Defense, Combat To Hit Defense, etc. BUT! There are ~20 AI flag abilities which you could use for this purpose. Just give the battery component an AI flag, then instead of "Battery" put "AI Tag 01"
Check out Fyron's LCX mod as an example of that.
http://www.shrapnelcommunity.com/thr...7917&Forum=f23