Robert Downey Jr. is flying high as Hollywood’s “Iron Man,” but 14 years ago he was Inmate Number P50522, a drug addict sentenced to serve three years at California’s super-tough Corcoran State Prison.

Sadly, his son Indio, 20, faces the same fate. He’s been charged with felony drug possession after a cop allegedly saw him using a cocaine pipe on June 29. His arraignment has been delayed until he can complete his rehab this month. Now sources say that the actor is doing everything he can to ensure that his son avoids the same cycle of addiction and incarceration that he battled.

“The last thing Robert wants is for Indio to end up like him,” said a source close to Downey, who topped the Forbes magazine list of highest earning actors for the second consecutive year, banking $75 million since 2013, the same as the previous year. “He almost didn’t make it out alive!”

In 2000, The ENQUIRER reported exclusively that Downey was beaten into submission behind bars, choked and marked for death by a vicious jailhouse gang.

Those gritty revelations came from Downey’s fellow inmate Reginald Harris, who offered the famed actor some advice on how to deal with 
his troubled son.

“I’d tell Robert to put his foot down when it comes to his son because Robert’s been there!” Harris – who’s bounced in and out of jail since his release in 2000 – told The 
ENQUIRER. “Most drug addicts don’t want to hear what you been through, so Robert needs to show his son what he’s accomplished.”

“He needs to tell him, ‘Okay, so you experimented with drugs. That ain’t the end of the world. Look at me! It wasn’t the end of the world for me. I came out the other side. And look what I’ve done since I’ve gotten off drugs!’”Downey was sent to lockup in August 1999 after repeated drug-related busts. Referring to his son, Downey said: “There’s a genetic component to addiction and Indio has likely 
inherited it.”

Harris, an alcoholic now living in a Veterans Administration residential rehab program, told The ENQUIRER: “When I left prison, I told Robert that I’d pray he’d win his struggle with drugs. And he did. Now I’m praying his son will, too! And, maybe, Robert can say a prayer for me as well.”