
I know that i can do that, but that affects the whole palette, I want part of the palette. Because I could have a specific part of the image change colors and this would save on disk space and cut down on useless files.
It's easy to do color cycling with setcoloreffect, but does it on the entire image. I just want a small palette shift, besides, it would look cool

You could use color cycling in junction with a whole image color cycle as seen with your script. Kinda like the Atari, it could do color cycling

and still have whole palette changes while part of it cycled.