Patience is virtue. That forum is a better place for romhacking than here. This forum is mainly for development (which can include romhacking, but isn't exclusively limited to such). No offense intended in the least (newbies are always welcome), but the technical calibre of folks here tends to be substantially higher.
Odds are, the location in the ROM you've modified to reflect the palette change needs to be done elsewhere in the ROM for the other "animation frames" (vaguely put). In other words: unless someone has already done the work for you, you get to reverse-engineer the game to figure out where it's being done.
I recommend using something like FCEUX to narrow down what exact palette entry (offset) is being used for the sprite/frame of animation in question. From that, you should be able to deduce the location in PPU RAM that correlates with that palette entry
. You then can set a breakpoint in FCEUX's debugger for that PPU location, then reproduce the situation that causes the visual anomaly, and figure out what's responsible for writing that value to PPU RAM (the latter is the "heavy lifting" part). I can't tell exactly what you're referring to because grammatically your sentence is confusing; it refers to two separate things:
... When I play everything works fine, until I shoot. When I look at the HEX code the color code changes back to Mega Man's original colors, but when Mega Man gets hit his edited colors return ...