Check out the following thread and note the reference to Knock Sensors codes. When I got the Maxima, it was throwing an O2 sensor and Knock Sensor code. I only replaced the downstream O2 sensor and the KS code would return. Knowing the other two upstream O2 sensors were weak, I replaced them. After replacing all O2 sensors the Knock Sensor code hasn't returned.
Are you running 91 or 93 octane fuel? When my oldest son drives is younger brother's Maxima, he will fill up with regular 89 octane fuel that seems to aggravate a weak Knock Sensors and cause it to throw a code. Try to use at least 91 octane in the VQ30DE.
mileage-improvement-preventative-mainte ... 77211.html
On the first Maxima (a 95 model 5-speed) and the I30, I replaced the Knock Sensors, O2 Sensors, and changed the spark plugs (NGK Double Platinum) soon after purchasing the cars.
For the 99 model Maxima 5-speed, I waited till later and just replaced the downstream O2 sensor, then the upstreams. I have a new Knock Sensor in the box that I will use when I pull the intake plenum to replace the valve cover gaskets in September.