though that doesn't address the issue I believe.
You believe wrong then. I can make this ability do whatever you want. This is one of the easy ones.
Bah, if only there was a constraint of "IsSelf" then this would work perfectly.
Take the first ability you gave us (the cap ship shield restore), make the constraint say capital ship, and make the range 30 (or 20 or 15, something meaningful, but not 0 since zero means 0 range, not no range, and it cannot target anything at that point, not even itself), and then use the only in combat use time. Trust me, it'll work. When the cap enters battle and loses 400+ shields while at the first ability level, if it has enough antimatter, it'll use the ability automatically every single time. I've run it dozens of times over in the past day and it hasn't failed to fire off even once. According to the AI, the constraints in place pretty much say IsSelf without actually saying it. That's as good as you're going to get with this game right now.
For the frigates to heal caps, leave everything except the range and the levels exactly the same. As soon as a cap ship loses 400+ shields, then they'll rush on over and use the ability.
For the frigates to heal themselves, leave everything the way it is except change the constraint to frigates, and remove the intrinsic levels and change it to fixed level 0 or based on research upgrades to get more levels out of it, and the frigates with the ability, again, as long as they have the antimatter, they will use it on themselves... Or themselves and other frigates if the range is large enough to cover more real estate then itself.
It's an ability that is used by both frigates and capital ships (capitals have a version that's stronger)
I had attempted to set the aiUseTime to OnlyWhenManyTargetsHaveShieldDamage earlier, to no avail unfortunately. Bah, if only there was a constraint of "IsSelf" then this would work perfectly.
I guess the most confusing part of all of this to me is you're giving us a capital ship ability and constraining it to frigates with a self affecting buff and wondering why it's not working with an AI controlled Cap Ship. Or then using a trigger based on ships around it to get it to work on itself because there is no IsSelf constraint... You can't do that and expect it to work right. Honestly, this is a lot simpler then what you're describing it as.
One last thing, I don't know what ships you're working with, but in the stock game, there's only a few frigates that have more then 400 shields. In the case of a frigate having 200 shields and the ability looking for 400 before it triggers, it will not work because that ship cannot lose more then 200 shields. Through the entirety of a battle it can lose thousands of shield points, but the game only looks at what its max value is and what is remaining to calculate what has been lost to trigger abilities, not how much its lost overall in the fight.