It seems that you do not understand the working principle of AODV.
In fact, you do not understand the working principle of the routing layer in ns3. I suggest you carefully read the ns3 manual. You can learn about the principles of the routing layer in ns3 through OSPF or AODV because these routing protocols follow the basic simulation logic of ns3.
you may not understand the above process, the most important thing you need to know is how data packets are transmitted in ns3. How exactly does a data packet get sent from node1 to node2. This is an essential question. In ns3, the routing protocols (AODV, OSPF) specify almost a static protocol. By default, in the same subnet, every node is working and attempting to communicate. The reason is that when you decide to stop a particular node from working automatically, it is challenging to make it work again by any means. This is a difficult task.
Anyway, what you need to do is not to modify AODV but to re-examine your requirements.
I know there might be some ways to solve your problem, but you need to clarify your requirements