I haven't tried it, but the npc_change_sprite function in there changes the palette, so you should be able to use one of those (either pal_path_for_npc or npc_load_two_palettes__and_record). Is that code 100% working? I want to edit my post so other people don't have the same issues.