I’ve covered the PLA and the question how to replace a broken one before. First, when I repaired one of my C64 from back in the day, needed a quick replacement, and used an EEPROM on a simple adapter board. In a follow-up post I used a simple circuit suggested in a talk by Eslapion to test this PLA replacement for glitches and found plenty. Last but not least, I created a replica of the Super Zaxxon cartridge also to be used for testing the PLA. There is a lot more information online on this topic like the excellent Post on Breadbox64.