Minecraft respawn mobs function

I've been wanting to make a function where when you kill a mob, it respawns it when you right click this specific item on your team and automatically attacks hostile enemies. I made something where it just spawns two zombies on your team, but I couldn't figure out how to make it spawn an entity that just died, and also how to make it attack hostile enemies, as it would just act like a normal zombie that didn't attack you.
Continue to help post