Danny Castellano (Chris Messina) returns to The Mindy Project Tuesday for the Hulu comedy's final two episodes, but as viewers already well know, it's not under happy circumstances. The most recent episode of the Mindy Kaling comedy revealed that Danny' mother Annette, played by Rhea Perlman, has been diagnosed with cancer. Although she warned Mindy not to tell Danny, Jeremy (Ed Weeks) accidentally learned about her health struggle at the end of the episode, at which point he headed to comfort an unknowing Danny.

"It's a very satisfying and intelligent way to have Danny Castellano come back," Messina tells The Hollywood Reporter of his return for the final two episodes.

The return comes nearly two years after Messina stepped down from series regular to recurring status on the comedy midway through the super-sized fourth season. Onscreen, Danny was written out to an extent when he and Mindy broke off their engagement because they couldn't agree on how much Mindy should work following the birth of their son Leo. But while Mindy moved on with new love interests (her now-ex-husband Ben) and coworkers (Jody Kimball-Kinney), Danny remained a presence because of their child together. He popped up once in season five when they got trapped together in a broken elevator at Leo's school and then slept together. However, Danny then got married, as did Mindy. It wasn't until the beginning of season six, when Mindy's ex-boyfriend and divorce lawyer Cliff (Glenn Howerton) revealed he was also handling Danny's divorce that a Mindy-Danny reconciliation even became possible.

So should viewers till hold out hope for the pair? THR spoke with Messina about that as why he left the series, embracing the Danny haters and his next TV project, the HBO miniseries Sharp Objects.

Was it always the plan for you to come back for the final season? Or if not, how long after they announced this would be the final season did talks begin about you coming back?

It was always definitely something that I wanted to do and something that Mindy and I had discussed. But you know with television shows, certainly these long-form shows in its now sixth season, things change and move. The hope was always that I would be able to come back and I'm really thankful that that worked out.

Why did you want to come back?

Well, No. 1, I love them as a group, the troupe of actors, the producers, the directors we've had, the writers, the crew — it was some of the best people I've worked with and certainly funny as all hell. In going out and doing other stuff, I've just missed them. Also, I wanted to have closure with the show; to end with them was something that was very important to me.

We know Danny is coming back because of his mother's cancer diagnosis but what else can you say about his return?

It's just very meaty for me. I got to do some great stuff. I was really, really happy. Because they know I love doing it and always crave it, they would give me some of the more emotional stuff and I really looked forward to those episodes. Comedy is incredibly difficult, and I always was very intimidated by this cast because they have done it from the beginning and up until the end with such ease and it was really always second-nature for them.

How precise you need to be when you're in a comedy, and the honesty you need and to have those two things meet up and have the execution just right, I always found very difficult. I would be very intimidated and frustrated with myself for fumbling a joke or not landing things the way I thought it should be or possibly the way they wanted. They were always very patient with me. They would throw me this great emotional stuff and that's something they did at the end where they gave me a bunch of funny moments but there's an emotionality to it that I think will be very unexpected.

Did you see a difference in your own approach to the material in season one versus season four?

Yeah, I did. I felt like I started to get into a rhythm with it and understand it more and feel more comfortable with it. There's a certain kind of looseness it requires and when I got to that place, of relaxation, a place of not controlling the comedy, just taking the cast's lead really and leaning into it, I found I got better results. With a drama, if you're getting a divorce from somebody and you're in the scene with that person, that divorce is prevalent to you as an actor. It's this underlying tension or elephant in the room and you can use it or fall back on it or bring it to the surface. In a comedy, if two characters are having a divorce, that's kind of death if you're just leaning into that. You almost have to drop it and not lean into it, have it be there and then kind of play back and forth with the jokes and the writing and get into kind of a banter with the other actor in the scenes. It was interesting to get around that. Sometimes in a comedy you have to let go of that stuff and ride the wave of the farce of it all. When I started to do that more in later seasons, I found it very enjoyable.

Has that informed other performances of yours since then?

Absolutely, without a doubt. I honestly think comedy is probably the hardest stuff to do. When it's done really well, the joke is disguised and there's just a looseness to it and there's an ease to it which I feel everyone in the cast really had. I think it's just magical. I got to experience that on Live By Night. The character I played in that movie, there were some really great one-liners that he had and I think I would not have known how to handle that or probably been too heavy-handed if I had not had the experience on The Mindy Project. There's something about, in a drama finding the comedy and then in a comedy finding the drama, that's interesting and certainly The Mindy Project taught me that.

Was it harder at all to get back into that rhythm on these last episodes after some time away?

It was, yeah. I was saying that to Mindy. I kept going, "Is this the character? Does this make sense?" I had texted [actor-writer-producer-director] Ike [Barinholtz] and [writer-producer-director] Dave Stassen and said, "Keep an eye on me because I'm going to need your help adjusting back and making sure I'm in the right place." One of the things about coming back that I really noticed and appreciated, maybe it was me having grown up a little or going away from this family, but in coming back I noticed how hard they all work and how much it takes. It's really a village, there are so many great people that keep that show going. I noticed the juggling that Mindy does. I had always seen it and recognized it, but maybe I opened my eyes more to the juggling she had to do and she did it with such grace. To be the lead of your own show, and to be writing and to be producing and to be casting and to be editing and then promoting it — it's a marathon and it demanded a lot of her and she made it seem easy so I think I took it for granted. And then in coming back to the show, I was overwhelmed, to be honest with you, with how well she did it and how second-nature it seemed to her. I didn't know what was going on inside of her but it always seemed like it was just what she did.

The great thing too is, the longer the show goes, it becomes this well oiled machine. What would have taken us in the first season many takes and many rewrites and many decisions to say, "Is this scene right? Is this scene working?," it was flying by with ease [now].

How emotional was it to be on set for these last few episodes? What was the mood like on set?

It was very emotional because you see so much change in people. People with new families and new loves and just as artists, they're working on other projects and they're going onto other shows and you just see people grow. You spend 12, sometimes 13, 14 hours with these people a day and you learn about them, you learn their insecurities, their wants and dreams and needs and so you root for them. I think there are friendships there that will last really forever. I love all of them so dearly and I hope to work with them again.

Given that, why did you decide to step down as a series regular in season four?

Mindy was always cool with me and understanding that in doing the show, that I wanted to have time to do other projects whether that be movies or a play or directing — I directed a movie when I was there and getting another one together — so she was always very open. She knew coming onto the show that was a worry or concern of mine, and she stuck to her word. She said, "I want you to be able to do stuff." She has so many projects and other things so she understands. I had an opportunity with Ben Affleck and Live by Night, it was a role I don't often get and it was something that I had been involved with for a while and the dates kept changing and she was very understanding. It was kind of like a dance of schedules and that. The show, in my absence, kind of moved and shifted and changed so this is where it ended up. The writers have always done an amazing job — which I think you'll see this at the end of this season — of taking the situations with me or any other actor and scheduling and what they had and adjusting to it and writing towards it and using it. I think that's what happened with Danny Castellano. They were in this situation now where they were like Chris wants to do this and we're going to let him do it and how do we do it? It became a very interesting plot point in the story, something we hadn't seen on television in a comedy like this before.

Despite those changes, particularly for the Mindy-Danny relationship, there are still very fervent fans of the relationship. Has that surprised you at all? What do you think is the reason for that?

It's so nice. Coming from New York theater, where off, off, off Broadway people very rarely saw the work and they were small theaters and then independent films where they make it out of the film festival for one weekend if they're lucky and then you've got to hunt for them on Netflix, it was an amazing experience to go get a pizza and have people asking what's going to happen with Mindy and Danny. It's an incredible feeling as an actor to be on something that people care about it. Some people have gotten mad at Danny, and I think that's terrific. It opens up a discussion about men and women in relationships and how to be treated and how to stand up for yourself. The more they got mad at him, I would understand and agree with a lot of it and then the more they could love the two of them together, I understand and agree. The passion for the two of them is only a testament to Mindy and the writers to creating really interesting characters and situations.

Looking at the fact that you're returning for the last two episodes and Mindy and Danny are both single again, should viewers hope for a reconciliation?

I think they should be hopeful for something very unique and special. They should be hopeful. I think it’s a very satisfying ending. When I read it, I felt it was a great way to end the show.

You spoke about wanting to do various types of projects, including theater and directing, so was that a concern when you signed on for HBO's Sharp Objects series?

I only signed on for eight episodes so it was only a March through August commitment. It's something, again, that I had never played before with Amy Adams, who we've worked together before and is a great friend of mine and an extraordinary actress; Patty Clarkson, we've worked together before and is an extraordinary actress. It was a great experience and an intense commitment to really incredible material. It felt like a long movie.

There's a lot of anticipation for this. What can you say about the tone of the show? What projects do you think it will draw comparisons to?

The book by Gillian Flynn is beautiful and dark. I read that book so quickly, you just have to find out what happened, what's going on here. But I think it's a very different tone than anything that Jean-Marc [Vallee] has done. He's a really interesting director, works very differently than I've ever worked before and in the beginning, I found myself trying to figure out how to adjust or how to maintain in the way he works and I found it extremely freeing and a style of working that I will crave to do again. He doesn't rehearse, he uses all available light and handhelds — it's very free. It's not standard filmmaking that I've ever experienced so I learned a ton.

All these projects, they bleed into each other and you carry them — again as corny as it sounds — you carry them, the good and the bad with you. When you don't like something and it didn’t feel right and you felt you weren't kind of seen or able to do what you thought you could do, you bring that into the next project and the opposite; when you feel like you were given wings as an actor and seen and able to try and be free and explore and dig in the dirty, you bring that to the next project. I've been lucky because I keep stealing and borrowing from all these great people, certainly Mindy Kaling being one of them.

Looking ahead, with the current landscape of television, would you sign on for another longer series commitment like a Mindy Project?

I would. I have young children and I like to spend time with them so my decisions revolve around that a lot but it always changes, yeah. It depends on the time in my life and the material that's coming at me but I'm incredibly open and obviously there are amazing things out there in TV especially. I'll always love films; I love plays. Hopefully if I'm lucky, I'll keep getting some opportunities to work.

What about another comedy?

I'd love to. I would definitely do another comedy. The main thing about doing a comedy is that you spend most of your days really happy and laughing. Every time I was on that show, there was never a day that I didn't laugh hysterically. What a great way to live, what a great gift to go to work doing something you love and it was shot in Los Angeles. Especially in dark days and tough times, it's a great way to get through, with laughter. Without a question, I'd love to do more comedy.