Magnetic tunnel junctions (MTJs), a key component of spin transfer torque magnetic random access memory, are typically fabricated using two main processes: plasma etching and in situ protective cap layer deposition. It has been found that while the etching process predominantly affects MTJ performance, the cap layer process can further enhance electrical and magnetic properties. In this study, we achieved performance improvements in MTJs by optimizing the cap layer deposition process through various experimental methods, such as modifying the gas mixtures used in the deposition process and incorporating a novel post-plasma treatment. During the deposition of the silicon nitride (SiNx) cap layer, N-rich dissociated compounds can induce passivation of the MTJ layer, leading to additional loss of tunneling magnetoresistance (TMR) and coercive field (Hc). To circumvent this challenge, we prioritized modifying the gas ratio in the SiNx deposition process. Additionally, hydrogen introduced during SiNx deposition can penetrate the MTJ pillars and degrade their properties. To mitigate this, we developed a novel post-nitrogen plasma treatment in a plasma-enhanced chemical vapor deposition chamber, which effectively desorbed the excess hydrogen from the MTJ film stack. As a result of these optimized processes, the TMR loss, compared to a blanket wafer, was reduced from 25% to 8%, and Hc increased by up to 33% for the same stack, achieving significant performance enhancements.