The trick to adjusting the cones on a rear hub is to leave the freewheel/freehub side alone, and loosen the non-drive side nut and cone. Then you pull the axle out from the drive side. This leaves the cone/nut-axle spacing intact.
Sounds like you disassembled the axle entirely. Simply tighten the drive side cone/nut first, taking into account the correct amount of exposed axle. Slide it in and adjust the cone/nut at the non-drive side.
If the cup inside the freehub is pitted, a replacement freehub body is the easiest fix. If it's in the hub shell, then it's best to replace the hub. Shimano doesn't sell replacement cups.