Indio Downey was ordered to take part in a 90 day residential drug treatment programme which, if he successfully completes it, will see his case dismissed.
"If you stay out of trouble for 18 months this case gets dismissed," judge Keith L. Schwartz told aspiring musician Indio, who was arrested for the offence in June.
"You're in a unique situation," he added in references to the 21-year-old's famous father, who sat in the courtroom. "I think you're going to be able to beat this because I know in life people always look up to superheroes and I think you might have insider contact to one superhero and that's Iron Man.
Robert Downey Jr.'s son is charged with drug possession
"I think if you have contact with that person," he added. "They can give you insider winsdom and help you make sure you do this well."
Speaking to E! News back in June Robert said of his son's arrest: "We're grateful to the Sheriff's department for their intervention, and believe Indio can be another recovery success story instead of a cautionary tale.
"Unfortunately there's a genetic component to addiction and Indio has likely inherited it," he added in reference to his own battle with drugs. "Also, there is a lot of family support and understanding, and we're all determined to rally behind him and help him become the man he's capable of being."