You'll need to duplicate the "256 colors" block:
if &t_Co > 255
" color definitions
endif
in order to create an "8 colors" block:
if &t_Co == 8
" color definitions
endif
and edit every color value in that new block according to :h cterm-colors
.
Good luck.