Correlated dynamics of hot and cool plasmas in two solar flares