Plot comes first, humor second. I've seen too many stories where every character just becomes a quip machine, and the actual story falls apart. Comedy should serve the plot, not derail it. Like, I read this 'Star Trek' crack fic where the whole bridge crew just roasted each other constantly, which was funny for two chapters, but then the Borg showed up and the tone shift gave me whiplash. The jokes completely undermined the threat.
I think a good rule is to let the humor grow from the characters and situations, not force it. If your characters are in genuine danger, maybe one of them cracks under pressure with a nervous joke—that works. But if they're all doing stand-up routines while the world ends, it feels cheap. The funniest parts often come from a straight-faced character dealing with absurd circumstances, not from everyone trying to be funny.
Keeping some stakes and consequences real helps the jokes land with more impact later on.