Why does my shower only get hot when the sink faucet is on?
Try pulling the cartridge out and turn on the water valve back on. Look to see if you have good flow coming from both hot and cold water holes.  Doing this could blow out any debris in the lines restricting flow. Cartridges act weird when water pressure is not balanced between hot and cold.  

Try turning off just cold supply and then just hot supply so 100% of water pressure is directed to clear out any debris. 

Some showers have built-in valves for hot and cold.  Adjust them so same flow is coming out of both holes.

Did you try adjusting the hot water safety limiter? It basicly just stops the handle from turning all the way to hot.