Predicting the thermodynamics by using state-dependent interactions