### Is there an existing issue for this?

- [X] I have searched the existing issues

### Current Behavior

I'm trying to create a state machine using the following definition that I validated on AWS:

```json
{
  "StartAt": "GetSuffix",
  "States": {
    "GetSuffix": {
      "Type": "Pass",
      "Parameters": {
        "suffix.$": "States.ArrayGetItem(States.StringSplit($$.StateMachine.Name, '-'), States.MathAdd(States.ArrayLength(States.StringSplit($$.StateMachine.Name, '-')), -1))"
      },
      "End": true
    }
  }
}
```

It fails with the following error:
```
│ Error: updating Step Functions State Machine (arn:aws:states:eu-west-3:000000000000:stateMachine:my-state-machine): InvalidDefinition: Error=ValueError Args=["Expected 2 arguments for function type '<class 'localstack.services.stepfunctions.asl.component.intrinsic.function.statesfunction.string_operations.string_split.StringSplit'>', but got: '(FunctionArgumentList| {'arg_list': [], 'size': 0}'."] in definition '{
│   "StartAt": "GetSuffix",
│   "States": {
│     "GetSuffix": {
│       "Type": "Pass",
│       "Parameters": {
│         "suffix.$": "States.ArrayGetItem(States.StringSplit($$.StateMachine.Name, '-'), States.MathAdd(States.ArrayLength(States.StringSplit($$.StateMachine.Name, '-')), -1))"
│       },
│       "End": true
│     }
│   }
│ }
│ '.
│ 
│   with aws_sfn_state_machine.main,
│   on stepFunction.tf line 1, in resource "aws_sfn_state_machine" "main":
│    1: resource "aws_sfn_state_machine" "main" {
```

Based on my tests there seems to be 2 issues:
- Using a variable starting with `$$` as a function argument is not supported.
- Passing the result of a function directly as another function argument is not supported.

### Expected Behavior

The definition should be considered valid and the state machine should be created.

### How are you starting LocalStack?

With the `localstack` script

### Steps To Reproduce

Create a state machine using the provided definition.

### Environment

```markdown
- LocalStack: 2.3.0
- PROVIDER_OVERRIDE_STEPFUNCTIONS=v2
- Terraform v1.6.2
```


### Anything else?

_No response_
"'JsonToString'", "'Array'", "'ArrayPartition'", "'ArrayContains'", 
            "'ArrayRange'", "'ArrayGetItem'", "'ArrayLength'", "'ArrayUnique'", 
            "'Base64Encode'", "'Base64Decode'", "'Hash'", "'JsonMerge'", 
            "'MathRandom'", "'MathAdd'", "'StringSplit'", "'UUID'" ]
    symbolicNames = [ "<INVALID>",
            "DOLLAR", "DOT", "STAR", "COMMA", "LPAREN", "RPAREN", "LBRACK", 
            "RBRACK", "LDIAM", "RDIAM", "ATDOT", "ATDOTLENGTHDASH", "ANDAND", 
            "OROR", "EQEQ", "EQ", "TRUE", "FALSE", "States", "Format", "StringToJson", 
            "JsonToString", "Array", "ArrayPartition", "ArrayContains", 
            "ArrayRange", "ArrayGetItem", "ArrayLength", "ArrayUnique", 
            "Base64Encode", "Base64Decode", "Hash", "JsonMerge", "MathRandom", 
            "MathAdd", "StringSplit", "UUID", "STRING", "INT", "NUMBER", 
            "IDENTIFIER", "WS" ]
    ruleNames = [ "DOLLAR", "DOT", "STAR", "COMMA", "LPAREN", "RPAREN", 
                  "LBRACK", "RBRACK", "LDIAM", "RDIAM", "ATDOT", "ATDOTLENGTHDASH", 
                  "ANDAND", "OROR", "EQEQ", "EQ", "TRUE", "FALSE", "States", 
                  "Format", "StringToJson", "JsonToString", "Array", "ArrayPartition", 
                  "ArrayContains", "ArrayRange", "ArrayGetItem", "ArrayLength", 
                  "ArrayUnique", "Base64Encode", "Base64Decode", "Hash", 
                  "JsonMerge", "MathRandom", "MathAdd", "StringSplit", "UUID", 
                  "STRING", "ESC", "UNICODE", "HEX", "SAFECODEPOINT", "INT", 
                  "NUMBER", "EXP", "IDENTIFIER", "WS" ]
    grammarFileName = "ASLIntrinsicLexer.g4"
    def __init__(self, input=None, output:TextIO = sys.stdout):
        super().__init__(input, output)
        self.checkVersion("4.13.1")
        self._interp = LexerATNSimulator(self, self.atn, self.decisionsToDFA, PredictionContextCache())
        self._actions = None
        self._predicates = None