What I mean by this is, how can I make an enemy not move without it doing whatever things they usually do? Like how can make a Hammer Bro not move without it throwing its hammers
most npc actions are controlled by their ai fields. for example, the smb1 hammer bro throws hammers depending on "ai3". other npcs might have states which you can easily just keep setting to idle.
Instead of actually using the existing Hammer Bro. NPC, it can often be easier to reskin one of the existing friendly NPCs (like Toad or Peach or Megan) to be a Hammer Bro. These NPCs don't do anything on their own, so are perfect for purposes like this.