A few years ago, in 2012, I did this itinerary:
Fly to Gdansk (via Amsterdam from the US)
Taking trains between all Polish cities:
Gdansk (3 nights)
Torun (1 night)
Wroclaw (2 nights)
Krakow (3 nights)
Train to Czech Republic
Rent a car in Brno, stop in a few Czech towns for a few nights (like Cesky Krumlov), drive to Prague
Prague (3 nights - had been here previously)
I visited Berlin/Potsdam and Dresden on a previous trip:
Berlin (4 nights)
Dresden (2 nights)
with a stop in the lovely old town of Gorlitz in between (a bit of a detour but worth it).
The Polish trains were slower then and a bit run down, but I love trains and I didn't mind (and they were cheap! Even first class, which I never book in other countries, but well worth it on Polish trains!). The train between Wroclaw and Poland is a lot faster now I think. Still, if you don't mind buses, you might look for alternate bus routes between cities to save money.
I actually loved all of the Polish cities to some degree and felt I had enough time in all of them. (Notice I skipped Warsaw - not saying you should.) I really enjoyed the little old town of Torun (not really a small town but feels smaller than the other places in the old center) and recommend you stop at least for a few hours off the train to or from Gdansk if you train.
There are direct flights between Krakow and Prague once or twice a week on RyanAir I believe (never flown them - I guess I might if I had to). So you might take advantage of that connection if you can time it right, if it still exists in 2019. Otherwise, it's a long train ride (some direct now I think) between Krakow and Prague. If you could fly into Gdansk like I did to start, might train to Warsaw, train to Wroclaw, train to Krakow, and fly to Prague, then Dresden up to Berlin. You if you start in Warsaw instead, you could train to Krakow or Gdansk and fly to the other, then wind up in Wroclaw by train and on to Berlin - Dresden - Prague at the end if you can fly out of Prague. There are a couple of scenarios that ought to work, based on 2019 flight schedules...
My four nights in Berlin weren't wasted even though I didn't really love Berlin - there is a lot to see, and the city is big and spread out. Prague by contrast is lovely and charming (and very touristy) and can be explored much more quickly than Berlin (much smaller in the center I believe) but is one of those places I just hated to leave - a great walking town. I spent four nights in Prague the first time just because I enjoyed being there, but you can do with fewer nights than that on a constrained trip.
Krakow is a lovely city and less touristy than Prague, and of course there's Auschwitz which takes a day alone, so adding more beyond my three nights might make sense for you there. But do plan some time in Krakow itself, just to explore it.