'It just felt like the only way to go,' says Dan Goor

[WARNING: This story contains plot details from Tuesday’s season finale of Brooklyn Nine-Nine. Duck under the police tape at your own risk.]

Not cool, Lieutenant Hawkins. Not cool-cool-cool-cool-cool-cool-cool-cool-cool-cool at all.

Things did not end very well for Jake and Rosa at the conclusion of the hourlong season 4 finale of Fox’s Brooklyn Nine-Nine. Just how not very well, you ask? The jury returned a guilty-on-all-charges verdict for the two detectives standing trial for bank robbery, making for the sharp cop comedy’s boldest wuh-oh! what-now? season sendoff yet. Yes, they entered a bank with masks and guns, and shouted bank robber-ish lines, but that was simply to help sell the illusion that they were in on the crime with the dirty Hawkins (Gina Gershon) — the ballsy head of an elite NYPD task force that they had just joined — before they gathered the evidence they needed to take her down. But she was a cunning one, and whatever trick they had up their sleeve, she had two more: She framed them for the robbery as her squad members identified Jake (Andy Samberg) and near-fugitive Rosa (Stephanie Beatriz) as the masterminds of the scheme, and she stashed millions in an offshore account under their names.

Also of note: Gina is pregnant with a Boyle cousin’s baby, Charles’ hair just straight-up turned white, and Pimento accidentally-but-kinda-on-purpose snorted a half-kilo of coke up his nose.

Still reeling from that feeling of getting framed for stealing? Let’s break down the ramifications of “The Bank Job” and “Crime & Punishment” with a man who redacts nothing, Brooklyn co-creator Dan Goor.

ENTERTAINMENT WEEKLY: Let’s start with the obvious question: For that last moment of the episode, did the script just say, “Jake says ‘cool’ as many times as he can in 11 seconds”?

DAN GOOR: Honestly, there was a different line in the script, and on the set, we came up with him saying, “Cool, cool, cool, cool, cool, cool.” And then even when we pitched it to him, we said, “You say, ‘Cool, cool, cool,’ and then he did something that seems physically impossible where he seemed to say “Cool,” two times at one time, three times in a row.

What was the original line?

In the original script, he had his eyes closed, and he went, “And now I wake up… And now I wake up.” Then it went to black in one version. One version we were going to shoot, but didn’t shoot, was him waking up in jail. We had other [alternative lines], but at the end of the day, I just felt like, “Oh, there are so many shows where people wake up from a bad dream.” I was afraid that was confusing, that you’d be like, “Wait, was he dreaming?” I didn’t want anyone to think that he was dreaming. And then also, “Cool, cool, cool,” was perfect.

Things obviously aren’t cool, though. This ending is a rather bleak game-changer. Jake and Rosa got checkmated hard at every move by Lt. Hawkins. Was part of the fun that the audience wouldn’t expect you to go there and convict them, because things usually somehow work out okay in the end? Like earlier this year, just when Nine-Nine looked like it will have to shut down, it was saved at the last second.

It was very much of the [Brooklyn co-creator] Mike Schur school of write yourself into a corner that is impossible to get out of, and then spend the hiatus pushing it away and pretending like it didn’t happen, and then spend pre-production figuring out how the hell you’re going to get out of that hole. We had had this idea from the start of this season, that there would be an end arc like this, but we just didn’t know where we were going to end it. We knew it would end with a trial, and we knew it would end with a verdict, but there was a version which was like, “Should the verdict come back, and you don’t know what it is, and that’s the cliffhanger?” But at the end of the day, it just felt like the only way to go.

What were the challenges and concerns with putting together this ending? Was there any debate in the writers’ room about it going too dark or too far?

I don’t know if there was so much a debate of whether it was too dark in the moment, but I was and am nervous about what it implies for next season, although I can tell you that today was Day 1 [of the writers beginning work on season 5], and we already have some fun, funny ideas. But of all the cliffhangers we’ve had — of all the big game-changers we’ve put Jake in the Nine-Nine through — this one feels like the most difficult to extricate ourselves from.

At the end of last season’s finale, Jake and Holt (Andre Braugher) went into witness protection. You then delivered on the promise of witness protection at the beginning of this season, so is it safe to assume that you will do the same here and at least send them to prison for a little bit? Are we going open season 5 with the two of them in jail?

I can’t answer that with a 100-percent surety, to borrow Donald Trump’s word, but I think the preponderance of the evidence suggests that we should examine it. I can tell you there will not be a yank. There will be not somebody running down the aisle of the courthouse saying, “He was innocent! He was innocent!” or cutting to him on parole and an appeal happening. We want to do the juiciest, funniest end result of the conviction.

If you do send them to jail, isn’t there an additional challenge because their genders would put them in separate prisons? Throw in what’s happening at the precinct, and you’re already jockeying between at least three different points of story — and that’s if the squad has a group storyline.

Yes, that is definitely an additional challenge because of their genders, for sure. But I think we have some fun ways to deal with that. At least for a few episodes.

What did Andy and Stephanie say when you pitched them the finale?

They were into it. They thought it was really cool. They loved doing stories together, so they were really into the Rosa-Jakeness of it. They liked how dark it was, and it felt like something they could sink their teeth into.

Will Gina Gershon be back in some form at the beginning of the season?

We’d love to have her back. It’s all schedules and how the story plays out. I think we would need to have her back to play out the end of the arc.

Let’s talk about another Gina [Chelsea Peretti], who is now pregnant with Boyle’s cousin’s child, who will be named The Enigma, or The Enigmo. Will we peek more into Gina’s home life next season? And is Ryan Phillippe returning next season as the professional snowboarder/father of her baby? We saw only a very quick scene with him, and this could spell a big story line with him being the father.

I would love to have him back for much more. I think he’s super-talented. We’re all huge fans of his. I think that’s just schedule-dependent. And yes, we’ll definitely see more into Gina’s life. Realistically, we will not be seeing much of Gina at the beginning of the year because Chelsea is pregnant, so she’ll be on maternity leave for some part of the beginning of the year. And fortunately, the character is pregnant, so the character can also be on maternity leave, or some funnier version of it.

What was the biggest or most unique production challenge when you were making the finale?

It was hard to shoot the pigs because they kept peeing on each other — and clearly enjoying it.

Does bonus footage of Holt (Andre Braugher) in the Razzmatazz class exist that will be put on the season 4 DVD?

Unfortunately, there is not. Although Andre insisted on doing the class for an additional 90 minutes.

NEXT PAGE: Goor on the show’s last-minute renewal — and what’s in store for season 5

As you said, this episode was written as a season finale, not a series finale, and you were optimistic that the show was coming back. The renewal came down to the wire, though, during upfronts week. Did everyone start to get nervous as show after show around you was renewed or canceled?

In today’s world of peak television, you’re always a little bit nervous. Once we had been off the air for as long as we were, and came back, that definitely softened up our ratings, which made us a little more scared. But the network was very supportive all along, and really told us early on that we were not a bubble show, that we were coming back. We’re [a] Universal [produced show] for Fox, which just meant that there are different contingencies and negotiations that go on that really have nothing to do with the creative or how much they may or may not like the show.

How many more seasons do you realistically see the show doing? How many more would you like to do?

I think we can do six or seven seasons. I would love to do that. I really feel like the fourth season in a lot of ways was our strongest season. And the actors are so good; they know their characters so well, and are so facile on set, I’d love to do more with them. I could see a few more seasons, if we were so lucky.

How do you and Mike feel about your Tuesday-at-9:30 p.m. time slot competition next fall, with Brooklyn going up against The Good Place [which Schur also created]?

I will destroy Mike. No. [Laughs.] I think given DVR technology, it is possible for people to both of these excellent shows. I think Brooklyn Nine-Nine is uniquely more enjoyable with advertisements watched, while The Good Place is one you definitely want to skip through those ads…. I just pity the poor Bull viewers who like our show.

Back to the finale: The scenes with Pimento (Jason Mantzoukas) are fantastic, whether he’s negotiating the terms of his fake beating with Jake and Rosa (“you can use fire”), or getting into the beating that Jake is giving him, or not-so-accidentally doing a ton of coke while trying to teach Jake and Rosa how to pretend to do coke. What do you remember about shooting the coke scene? And how much comedic leeway do you give a guy like Mantzoukas, who can go in so many amazing and absurd directions on the fly?

Jason is such an incredible comedy actor but also an amazing writer and also an amazing teammate. It should be noted that he does the script; he does what’s written for him and doesn’t undermine it in any way. He is only adding to it. That said, we 100-percent appreciate his ability as one of the greatest improvisers alive. When we write something like the cocaine scene or the scene where he’s giving the instructions for what can be done, we do it with the hope and the belief that he will take what we’ve written and make it even better. He does the script, and then he does more. And then we usually take some from the script and some from the more.

It’s funny, he had a slightly different take on the cocaine thing than was intended, and I love what he did more. In the original writing of it, it was sort of accidental that he was snorting the cocaine. And then in the shooting of it, you can see in his eyes, he’s clearly going to do it, and that is a much funnier choice. Somehow that works really well with the lines where he keeps saying that it’s an accident but it’s clear that it’s not an accident.

What’s next for Amy (Melissa Fumero), now that she’s passed the sergeant exam? Will she find temporary placement at another precinct before Holt figures out how to add a second sergeant to serve alongside Terry (Terry Crews) in the Nine-Nine?

The truth is, there are two things that are contradictory. Realistically, it is unlikely that a squad like this would stay completely intact for this long no matter what — people get transferred, sergeants, et cetera. But squads can have multiple sergeants, so my guess is that we will make her and Terry both sergeants, and that will create interesting power dynamics.

What else can you tease about season 5?

This is hard because it really is Day 1. … I already know there are going to be some big moves between the characters. I can tell you it’s going to be the best Halloween we’ve ever had. I can tell you that the 99th episode, which right now is scheduled to be Thanksgiving, will be a big deal. And more flashbacks than ever before to Hitchcock and Scully’s drug-induced stupor of the ‘80s.