Automatic charge current creation

Hello guys,
I am new to Node RED and have made some simle function and dashboard to use on my boat.
I am now trying to make the code in the picture. It is not working and I made it just for illustration only.

What I am trying to make is this:
I read in the battery state of charge, if the Automatic charge current switch in the dashboard is set to TRUE, a value of X (120 in my example) is sent further.
Then I want to reduce this value based on a temperature input.
After the temperature reduction the value is sent to Charge current limit.
If the value is over 20% I want no value to be sendt to the Charge current limit node.
Instead I want to use the next line to adjust the 20-30%, 30-40% and so on.

Can someone please be so kind to show me how?
Remember I am all green here. Please feed me with a teaspoon :slight_smile: