Was cuba a colony of Mexico before the Spanish American War?

No, both Cuba and Mexico had been colonies of Spain since their beginnings. Mexico had won its independence in 1825, but Cuba was still a Spanish Colony in 1898. The US felt that the crumbling Spanish Empire had no business clinging to anything in this hemisphere.