Cosmological scalar perturbations in Horndeski-like gravity