First of all apologies for the late response
After some slight tweaking it indeed worked for non-locus units. What should I place at the "else" field then? Leave it blank? Also thank you for bringing up the leak issue, I saw the thread linked in your signature and will give a proper read these days.
After some tweaking it did end up working, but for non-locust units. I haven't tried the chaos method you mentioned, but I'll just stick to the one proposed by Uncle since it works really well.
As to why I want the ability to work this way. The summoned units basically gain one of the hero's passive abilities, based on its current level. So if that passive hasn't been leveled up, then the units won't get it either.
Thank you guys so, so much for the aid. I'll be using both of your methods in the future.