That sounds like a job for Readied Actions!
(Our DM tried that with the dragon at the end of Icespire Peak, but fortunately my character had a spell that grounds flying enemies and it failed its save. Dragons aren't nearly as bad when you know they're coming and have an entire campaign to build your character towards fighting them. Surprise dragons are a nightmare though!)