If you own the NCM module license, you should use it instead of creation everything similar by your own
I am afraid it is too tricky for me, sorry. It would mean analyzing deeply the NCM module code to find out what is missing in your case, and I am quite busy by now. Perhaps should you ask for Adobe consultancy or Integrator consultancy, but other way is to consider buying NCM. Or other approach perhaps?