I did the patch, I replaced the ‘cite while you write’ file but it is still adding all references found to the currently open library
You mean patch for X2? Training video is here.
Take a look at “Online Search in Online Search Mode”. It explains how to do the online search in >X2.0.x