SANTA ANA – Attempted murder charges were dropped but immediately refiled on Friday against the troubled son of a former star on “The Real Housewives of Orange County” after it was determined his right to a speedy preliminary hearing was violated.

Joshua Waring, 28, is again facing three counts of attempted murder for allegedly shooting and wounding a man in Costa Mesa in June 2016 and then leading police on a chase.

Two other people, a man and a woman, were standing nearby but were not hit, prompting prosecutors to file the two additional attempted-murder charges.

His public defender repeatedly requested delays for the preliminary hearing over Waring’s objections, and a judge initially denied Waring’s requests to represent himself.

Waring was appointed a new lawyer, Joel Garson, who filed a request to have the charges dropped over a violation of his civil rights. Prosecutors did not contest the motion and immediately refiled the case after a judge agreed to dismiss the charges.

Waring’s mother, former reality TV personality Lauri Peterson, sat quietly in the courtroom taking notes on Friday.

Even before the most-recent incidents, Waring, a San Juan Capistrano resident, had more than a dozen misdemeanor and felony charges, mostly drug-related.

He remained in custody in lieu of $1 million bail and has racked up even more charges while in the Orange County Jail.

In November, he was charged with a felony for allegedly having an alcoholic beverage in jail. In July, he was again charged with felony possession of an alcoholic beverage and a misdemeanor for allegedly being under the influence of a stimulant.

According to court records, Waring was in possession of “pruno,” an alcoholic drink made from fermented fruit, ketchup, sugar, bread and other ingredients.

Waring is now facing a dozen felonies and misdemeanors including attempted murder, battery and assault for the alleged June 2016 incident.

He is accused of shooting a 35-year-old man in the lower torso on the 2900 block of Babb Street in Costa Mesa and then fleeing in a BMW. He led police on a chase, at one point getting into a traffic accident, authorities said, and then took off on foot before surrendering in a Santa Ana store.

Peterson was one of the original “Real Housewives of Orange County” in 2006. Three years later, after her son’s legal and drug troubles surfaced, and because of a desire for privacy, she bowed out.