You can refer to lambda X inside lambda Y, but remember that everything external referred to in a lambda (except Items) must be passed into it.
You’ll need to add another parameter and pass in the name of the lambda function.
Examples (ignore the Timer stuff, the interest is passing one function to another)
For your string (IP) you have a choice of either passing it in as another parameter, or put it into a String Item where you can get at it.