It's very strange that he kept on producing meat flaps. :/ That's not good, at all.
Seems like it is definitely an infection that's killing him off. :/ Very sad, given that he was doing so well.
The only thing that I can think of (this was what my friend done, once), is to crush up penicillin and dissolve it in the tank. I don't even know if this would work in this case, my friend had fish that was infected with something and was extremely desperate so she placed her fish in separate containers and sprinkled penicillin in each of those so that the fish would gulp it up. She also added actual individual smaller pieces in mixed with normal pellets later on. The fish got better in the end, but she was also doing high temps and melafix and all that, not sure what helped and what didn't.
Donno if it would work in this case but the only thing I can think of now mate. :/ Try or not try at your risk, maybe wait for a while more and see what happens perhaps.