SEATTLE — The state of Washington has agreed to a plan to resolve a lawsuit filed on behalf of mentally ill people who’ve been warehoused in jails for weeks or months while awaiting competency services.A settlement reached Thursday between Disability Rights Washington and the Department of Social and Health Services is designed to bring the state into compliance with a judge’s 2015 ruling that said the state was violating the rights of its most vulnerable citizens. The plan also will end the contempt fines the state has been paying for years. So far, those fines have topped $60 million and average $3 million to $4 million each month.U.S. District Judge Marsha Pechman must approve the settlement before it gets implemented.“Every day that someone with a serious mental illness sits waiting for help in jail, they get sicker,” said Kimberly Mosolf, attorney for Disability Rights Washington. “This plan will keep people out of jail when mental health treatment and community supports are more appropriate, and it will get people with mental illness who are currently in jail into community settings where appropriate.”The lawsuit, filed in 2014, sought relief for criminal defendants who were languishing for months in county jails while waiting to be evaluated to see if they were competent to help in their defense. When many of the defendants were found incompetent, they had to wait weeks or months before being taken to a state-run mental hospital for treatment. The suit claimed the state was violating their constitutional rights.Even though Pechman found in the group’s favor in 2015, many are still waiting for competency services.The two sides joined with others to devise a plan to get the state into compliance. Participants included family members, lawmakers, behavioral health organizations, law enforcement agencies, jails and courts. “This settlement reflects the ideas of those people closest to the problems and most knowledgeable about what it will take to fix those problems,” said David Carlson with the rights group. The proposed settlement “lays out a comprehensive plan to reform the way we treat people with mental illness who interact with our criminal justice system,” he said.