Robert Downey Jr., 36, has reached a tentative agreement with prosecutors in which he’ll plead no contest to at least two of the three charges against him after his Thanksgiving drug bust in Palm Springs, Calif., reports PEOPLE in an exclusive. The charges are one felony (cocaine possession) and two misdemeanors (being under the influence of drugs and possessing Valium without a prescription). In exchange, sources tell the magazine, he will avoid prison time (a possible maximum sentence of up to four years) and remain in a residential drug treatment center for six to 12 months. Downey’s attorneys and Deputy District Attorney Tamara Capone declined comment, though Capone told PEOPLE that it is anticipated the plea will be entered during the ex-Ally McBeal costar’s next court date, July 16. In April, Downey refused a plea-bargain deal that would have put him in jail for a year. The following month he was arrested in Culver City for being under the influence of drugs, which L.A. prosecutors treated as a parole violation (for his original 1996 conviction on drugs and weapons charges).