Technically an unwholesome mind state lasts less than 17 thought moments. The 7 Javana Cittas and the deciding Citta that precedes them are the only unwholesome part in a single unwholesome experience. If you are talking about removing the possibility of unwholesome mindstates ever arising, it is said that if you practice Satipatthana meditation with diligence, dedication and proper guidance, you will be able to uproot all possibilities of unwholesome mindstates arising within a minimum of seven days and a maximum of seven years.