I don’t know if this is scripting connection or it can be done with nth for example.
What I would like to do is to limit how many highpri marked connections one IP can have.
For example there mased on certain rules I mark one type of traffic as lowpri and another as highpri. Now I want to make it so no particular IP can have more than 10 highpri connections. If connection qualifies as highpri but IP has 10 highpri connections already I want to mark the connection lowpri (or something else like forced_lowpri). Any ideas?
I think that should be possible by first configuring passthrough=yes on your initial highpri marking rules, and then further down use connection-limit to re-mark if necessary:
I may be mistaken on how connection-limit counts the connections and if the other filters (connection-mark=highpri) limit what connections are counted.