SPOILER ALERT: Do not read if you have not yet watched “Grace’s Secret,” the Nov. 1 episode of “Will & Grace.”

One year after the #MeToo hashtag went viral, television scribes are still scripting their characters to give voices to those who have previously been pushed into silence. “Will & Grace” is the latest show to join the movement with “Grace’s Secret,” an episode written by Suzanne Martin, in which Grace (Debra Messing) first confronts her father (guest star Robert Klein) for being too friendly with a waitress and then reveals how his best friend forced himself on her years ago, when she was 15 years old and under his employ.

“It was everything going on in the world. It was having a president that absolutely has no respect for women by and large — certainly women that have been assaulted and then watching the Bill Cosby story unfold,” explains “Will & Grace” co-creator Max Mutchnick on the inspiration to do the episode. “That one-two punch really had us writing this episode.”

Co-creator David Kohan adds that there is often interest in trying to incorporate something that is part of the national dialogue into the show. With #MeToo, he says, it “felt like an obvious one” because “someone in this cast probably had a #MeToo moment.” The focus then became on doing the story in a way that “didn’t feel like it was pandering, but that felt authentic to the character,” he continues.

Here, Mutchnick and Kohan talk with Variety about conceptualizing the episode, which real-life events influenced the storyline and what they have learned about handling such big, episodic moments in the second run of the series.

How did Grace’s #MeToo storyline first come up?

Mutchnick: When this was all happening in the world and we were seeing it on the news and the season started we had a sense that this is something we needed to run through the characters. We actually weren’t sure how we were going to tell this story. And then we started to see some of the testimonials, and the women testifying about what Bill Cosby had done to them, and one of the things that really stood out for us was the import of these women standing up and telling their individual stories and how it empowered them and allowed them to digest something and work through a devastating episode in their lives.

Kohan: I remember the draft came in and then Brett Kavanaugh [happened]. Dr. Christine Blasey Ford gave her testimony and then Kavanaugh gave his testimony… his performance, and you realize the line that republicans had to walk on this is that, “We believe Dr. Ford, but we believe she’s misremembering.” It’s like, “We’re not going to walk into the trap of she was lying because she was so utterly credible, but if we can maybe make it, I know what we’ll believe, we’ll believe that she’s misremembering. We’ll choose to believe that.” So the line where Grace’s father says, “Maybe you’re misremembering” and she adamantly denies it, that was something that happened in the aftermath. The draft that came in didn’t have that exchange. But it was included after the Kavanaugh hearings.

Why was Suzanne Martin the right choice to write this?

Kohan: I actually don’t think we would have done this if it was just Max and me. We knew we weren’t about to write this episode.

Mutchnick: Oh yeah. We have very strong women in the room and the room is very personality based. In order to succeed in the writing room at “Will & Grace” you have to be willing to lay it out there for us to pick and choose the stories of your life and write about them. So we talked about this, and Suzanne was the one who could bring the most experience to this story. I don’t want to speak for her, but I think she would be OK with us saying that she was able to bring a very real point of view to this story.

Debra Messing has spoken out on behalf of the #MeToo movement. Did you give her input into developing the story?

Kohan: The input she had was input as an actress and as someone going through something in the scene. But more than anything, and what she kept saying is, “All I want to do is honor the work. I just want to honor the story and the words.” So it’s not like she was sitting there saying, “I think this should have happened and I think that should have happened.” She got the script and she said, “I understand this. This is something I can play.”

Mutchnick: This wasn’t Debra’s story…but that said it’s every woman’s story who has this story to tell. So she could interpret it and feel good about giving life to it.

Kohan: But if moments felt premature, if they felt a little pinky or a little like it didn’t feel natural to her, she would say something and we would all make adjustments. But we were all very much in sync that week. Certainly with that storyline.

If you could navel-gaze for a moment, where does this storyline stack up to some of the other issues “Will & Grace” has tackled over the years?

Kohan: In terms of dealing with something head on? Up there. Since we’re in the business of navel-gazing right now, I kind of feel like one of the things we didn’t do in the first run of the series was deal with AIDS head-on. We didn’t.

Mutchnick: Yeah we didn’t. We didn’t do a good job of that. And it’s like, we are kind of blessed to be in this position again where we have this voice and as long as we’re able to tell stories through these characters we should probably be striving to entertain people and make them laugh. But if we can reflect back what’s going on in the world that seems organic to the show we should probably do that. That’s what happened with this episode.

How important to your overall tone is it to balance a storyline like Grace’s in this episode with something super comedic like Karen (Megan Mullally) and Will (Eric McCormack) duking it out to be Jack’s (Sean Hayes) best man?

Mutchnick: We’re not writing “This Is Us,” you know? No disrespect to “This Is Us,” they do that very, very well. But we do have to get these people to talk about real things every once in a while because if they don’t they’re just going to float up into the air like helium balloons. It’s stuff like this that allows us to ground them. If we ground them this week then in the following week we can have Grace sitting on a hawk’s nest on the ledge of her building trying to save hawk eggs. It’s always a tonal balancing act.

Kohan: But there are certain things — it’s a sort of cut-through, and where it seems like the #MeToo movement and the dialogue around sexual assault is so clear. It’s so clear that it is something that needs to come to the fore and it’s also something that probably has happened to our characters. So we should do that. Maybe it’s also something about being older and less anxious about ratings and things like that, where once upon a time it was like, “How are we going to crack an AIDS story, and how are we going to do it so that it’s funny, and is it going to be palatable, and are we going to lose viewers?” We didn’t know how to throw all that in people’s faces and not have it be a “very special episode.” And now it’s more like, “Well this is something that really should be out there.” It seems like a natural fit for this show and these characters. So we have to find a way to do it, and do it unflinchingly.

“Will & Grace” airs Thursdays at 9 p.m. on NBC.