/if (${Me.XTarget[1].PctAggro} && ${SpawnCount[npc XXXXX`s pet radius 100 zradius 40]}>=1) /pet swarm
Likely not the best solution but it is what I am using atm until I find something better.
I didn't try putting ${Me.Name} in for the XXXXX yet I am putting each chars name in manually.
You could use that as a basis for qswarm using the various XTargets too but I didn't see a need for all that.