Multiply out the HP by however many you want there to be. Give them multi attack to that number. Say for example it’s 5 goblins in a swarm; every 20% HP lost it loses an attack (do the math ahead of time if it’s a funky number).
To make things less swingy run 2-4 swarms instead. Say you want 20 goblins, make swarm pods of 5 each.