My advice to a new LC owner is to learn to diagnose instead of just throw parts at an issue, you'll loose your net worth in about a year otherwise. You have a free downloadable FSM (Factory Service Manual) at your disposal here on the site. It is very through and will give you procedures to test out the circuit where the knock sensors are concerned with a multi meter. If all that's new to you I suggest you become acquainted with it and consider it part of the experience of owning a 30 year old utility vehicle.
as stated earlier the ECU is not a cheap or common replacement, but there is a section of your engine wire harness that comes in CLOSE contact with a hot EGR pipe near the back of the engine between the valve cover and upper intake. As those wires slowly fail one by one it'll make an engine do some funky things.