The values you are using should be correct for CPU and NET. max for the max the user has and used for what they currently have consumed. There should also be available which is how much they have remaining. used + available = max.
For RAM however it would be ram_quota and ram_usage.
So I would use something like this, changing the variable names to whatever ...
Staking EOS doesn't give you any interest. It provides resources (CPU/NET) for sending transaction and the power to vote producer.
If you delegate your voting power to proxy like this, they will give you reward. There are many proxies, so you need to compare them by yourself.
This means you don't have any EOS staked to NET bandwidth.
You can stake EOS using the eosio::delegatebw action, but it is a chicken and egg situation, because you need some NET bandwidth in order to stake some NET bandwidth.
Therefore I recommend you do it through a service like bloks.io, which offers 5 free transactions per day. You can use one of these ...
userres table does nothing about resource (CPU/NET) allocation and consumption. It depends on set_resource_limits only, and userres or delband manage staked or delegated amount of EOS and make it available to utilize this information from eosio and other accounts' contract.