My first thought is the car. Renting in one country and dropping off in another can be very expensive, if even doable between these two countries.
I would leave the car in Ljubljana and either train or bus to Zagreb for one night (take away from Korčula). Then pick up a car in Zagreb leaving it in Split.
Maybe forego the car in Slovenia and look for a day trip to Postonja and Predjama. Would save some aggravation and time.
When in Rovinj it is difficult to park so research this ahead of time. Maybe on booking.com research a place with parking. You could also look to stay in Poreč, close by with less tourists.
While in Istria, look to visit Pula, Groznjan or some other hilltop town. If you start out early, you can easily visit 2 in one day. We visited both Groznjan and Oprtalj in one day - you can drive up to the top, parking ample (small fee in Groznjan, free in Oprtalj. The latter has a fabulous restaurant, Konoba Oprtalj, with glorious views).
It looks good if you are agile enough for what I call fast travel. We tend to stay at least 3 nights in a place.
By the time you get to Dubrovnik you might be slowing down. If you miss the day trip to Cavtat it wouldn’t be too big a deal. It’s a lovely coastal town, but so is every place along the coast. Spending two days in Dubrovnik wouldn’t be a hardship.