It might have been cheaper/easier to fly into Venice and go immediately to Trieste for the first night, so you wouldn't have to backtrack from Ljubljana to Trieste - assume flights are already booked?
Assuming you will fly into Ljubljana, and that you have 17 nights (18 days), here's how I might do it:
Ljubljana (3 nights)
Train to Trieste
Trieste (1 night)
GoOpti shuttle to Rovinj
Rovinj (3* nights) Rent a car (day trips to Pula, Istrian hill towns)
Plitvice Lakes National Park (1 night)
Sibenik or Zadar (1* night) - maybe side trip to Krka National Park for 1/2 day
Split (2 nights) Drop car on arrival
Korcula or Hvar (2 nights)
Dubrovnik (2 nights)
Dubrovnik is small - you don't actually need a lot of time there, unless you are doing day trips. But you could steal the night I added in Sibenik/Zadar if you want one extra night in Dubrovnik (it is your departure city so the last day is probably shot) or a night from Rovinj, which itself is tiny, but you may want to spend the time exploring hill towns in the Istrian interior or perhaps see the Roman ruins in Pula. If not, you could cut a night from Rovinj.
I left out Zagreb because I'm personally not a fan, and because you will be in Trieste, it's a long way back to Zagreb. But, you could go from Trieste to Zagreb (trains, connect in Ljubljana again) and do two nights there instead.
Be prepared for a steep one-way drop fee for a rental car picked up in Slovenia and returned in Dubrovnik. Sometimes the fee is acceptable, but check into it. Could be hundreds of euros extra. I have given you the option to do avoid that, but you could ignore my option and just rent the car in Ljubljana and return in Dubrovnik as planned. (Try Sixt.) You could also rent a separate car in Slovenia, drive it to Trieste, drop in Koper, take a bus or GoOpti shuttle on to Rovinj, and rent another car there. Or skip the car in Slovenia entirely. You can day trip to say Lake Bled easily by bus, and you don't really want a car in Ljubljana itself. Might not want one on Korcula/Hvar, either.
You could visit say Mostar, Bosnia instead of doing the island stop. All up to you.