So, when spawning the doom shroom. Run back to the entrance of the boss room.
Once there there will be a small roof above your head, this is where the cheese comes in.
Once the shroom gets under the roof and jumps into it he will be stuck against the roof.
He wont fall back down, dash at you, whatsoever.
He is perma stuck there because he wont fall back down.
So whack away while its still in the game