On “Saturday Night Live,” cast member Darrell Hammond had viewers howling with laughter over his portrayals of famous folks such as Bill Clinton, Al Gore and Sean Connery. But behind the scenes, the master impressionist’s life was anything but funny.

Hammond was cutting himself as he struggled with alcohol and cocaine abuse. Doctors over the years had diagnosed him as having schizophrenia, manic depression, borderline personality disorder, major depressive disorder and multiple personality disorder.

But the truth, psychiatrists eventually helped him to discover, was that his issues stemmed from childhood trauma.

“I became sold on the idea that the way I was behaving was best described as a mental injury rather than a mental illness,” Hammond, 63, tells The Post. “That’s the ‘Hallelujah’ chorus of my whole life.”

Hammond detailed his journey in a 2011 memoir, “God, If You’re Not Up There, I’m F - - ked,” and now his story is at the center of a new documentary about the effects of childhood trauma.

The film, “Cracked Up,” premieres at the DOC NYC festival with two screenings on Wednesday (tickets available at DOC NYC).

After Hammond’s daughter Mia was born in 1998, disturbing memories started to come back to the performer about his abusive mother.

“I held [Mia] in my arms,” says Hammond, “and the God moment for me was [thinking] — because she was so perfect — ‘What would you have to do to this child to turn her into me?’ That opened the floodgates.”

Growing up in a one-story home in Melbourne, Fla., Hammond appeared to live an idyllic life. His father, Max, ran a Western Auto store, and his mother, Margaret, was a Methodist churchgoer.

But behind closed doors, Hammond recalls, his mother was a monster. She slammed his hand in a car door, hit him in the stomach with a hammer and stuck his fingers in an electrical outlet. When Hammond was 3 or 4, she held him in her lap and used a serrated steak knife to cut an incision into the center of his tongue. His father, an alcoholic World War II vet, did not protect him. (Margaret died in 2006, and Max in 2007.)

“I literally believed I deserved it because I was bad and it was my fault,” says Hammond. “That was the only way I could reconcile with the fact that this was happening by one of my parents. It was easier to believe that . . . than to believe I wasn’t loved.”

Hammond’s breakthrough came in the fall of 2010, after he drunkenly attempted to saw off his arm with a kitchen knife, and ended up at a Westchester County rehab. There, he met Dr. Nabil Kotbi, who swiftly recognized signs of trauma in Hammond and helped him to address those issues through therapy.

Hammond and the film’s director, Michelle Esrick, hope the film will encourage more doctors to learn how to identify and treat trauma.

“I felt that if I could get that message out there — that this is a biological issue, how trauma affects the brain and the body,” says Esrick, “that it could actually lift the shame and the stigma.”

Today, Hammond continues cognitive therapy and participates in 12-step groups to help him deal with his complex post-traumatic stress disorder. He’s also returned to “SNL” as the show’s announcer.

“I can have really good days, but I really have to work hard for them,” he says. “And then on the bad days — which aren’t as often, maybe once a week now — I have these people and we buoy each other.

“You know, nobody helped me when I was a kid,” he adds, “but . . . I get a lot of help now.”