Magnetic excitations and lattice vibrations in uranium rock-salt structure compounds