Rewrite Plugin(s) to target Consumers (instead of Routes or Services)

Some of the Kong Gateway plugins (examples: cors or bot-detection) only target routes/services.

How can those be rewritten to target consumers (so that the plugin can be added to a consumer and not a route or service and would only apply if a consumer with the attached plugin hits the gateway)?

If I look at the code of the ip-restriction plugin (that can be attached to a consumer) in comparison to the bot-detection plugin (that cannot be attached to a consumer as of now), I only see a

{ consumer = typedefs.no_consumer },

in the schema.lua of the bot-detection plugin that should disable me in attaching it to a consumer.

So if I would delete that schema config setting in a forked plugin and than apply that forked plugin to a consumer, would that work? Or do I miss sth. in understanding the Lua code (novice there)?

Or is this endeavor more complicated?