### 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_
1,45,1,45,4,45,412,8,45,11,45,12,45,413,1,46,4,46,417,8,46,11,46,
        12,46,418,1,46,1,46,0,0,47,1,1,3,2,5,3,7,4,9,5,11,6,13,7,15,8,17,
        9,19,10,21,11,23,12,25,13,27,14,29,15,31,16,33,17,35,18,37,19,39,
        20,41,21,43,22,45,23,47,24,49,25,51,26,53,27,55,28,57,29,59,30,61,
        31,63,32,65,33,67,34,69,35,71,36,73,37,75,38,77,0,79,0,81,0,83,0,
        85,39,87,40,89,0,91,41,93,42,1,0,9,8,0,34,34,47,47,92,92,98,98,102,
        102,110,110,114,114,116,116,3,0,48,57,65,70,97,102,3,0,0,31,34,34,
        92,92,1,0,49,57,1,0,48,57,2,0,69,69,101,101,2,0,43,43,45,45,4,0,
        48,57,65,90,95,95,97,122,2,0,9,10,32,32,430,0,1,1,0,0,0,0,3,1,0,
        0,0,0,5,1,0,0,0,0,7,1,0,0,0,0,9,1,0,0,0,0,11,1,0,0,0,0,13,1,0,0,
        0,0,15,1,0,0,0,0,17,1,0,0,0,0,19,1,0,0,0,0,21,1,0,0,0,0,23,1,0,0,
        0,0,25,1,0,0,0,0,27,1,0,0,0,0,29,1,0,0,0,0,31,1,0,0,0,0,33,1,0,0,
        0,0,35,1,0,0,0,0,37,1,0,0,0,0,39,1,0,0,0,0,41,1,0,0,0,0,43,1,0,0,
        0,0,45,1,0,0,0,0,47,1,0,0,0,0,49,1,0,0,0,0,51,1,0,0,0,0,53,1,0,0,
        0,0,55,1,0,0,0,0,57,1,0,0,0,0,59,1,0,0,0,0,61,1,0,0,0,0,63,1,0,0,
        0,0,65,1,0,0,0,0,67,1,0,0,0,0,69,1,0,0,0,0,71,1,0,0,0,0,73,1,0,0,
        0,0,75,1,0,0,0,0,85,1,0,0,0,0,87,1,0,0,0,0,91,1,0,0,0,0,93,1,0,0,
        0,1,95,1,0,0,0,3,97,1,0,0,0,5,99,1,0,0,0,7,101,1,0,0,0,9,103,1,0,
        0,0,11,105,1,0,0,0,13,107,1,0,0,0,15,109,1,0,0,0,17,111,1,0,0,0,
        19,113,1,0,0,0,21,115,1,0,0,0,23,118,1,0,0,0,25,128,1,0,0,0,27,131,
        1,0,0,0,29,134,1,0,0,0,31,137,1,0,0,0,33,139,1,0,0,0,35,144,1,0,
        0,0,37,150,1,0,0,0,39,157,1,0,0,0,41,164,1,0,0,0,43,177,1,0,0,0,
        45,190,1,0,0,0,47,196,1,0,0,0,49,211,1,0,0,0,51,225,1,0,0,0,53,236,
        1,0,0,0,55,249,1,0,0,0,57,261,1,0,0,0,59,273,1,0,0,0,61,286,1,0,
        0,0,63,299,1,0,0,0,65,304,1,0,0,0,67,314,1,0,0,0,69,325,1,0,0,0,
        71,333,1,0,0,0,73,345,1,0,0,0,75,350,1,0,0,0,77,360,1,0,0,0,79,365,
        1,0,0,0,81,371,1,0,0,0,83,373,1,0,0,0,85,376,1,0,0,0,87,389,1,0,
        0,0,89,403,1,0,0,0,91,411,1,0,0,0,93,416,1,0,0,0,95,96,5,36,0,0,
        96,2,1,0,0,0,97,98,5,46,0,0,98,4,1,0,0,0,99,100,5,42,0,0,100,6,1,
        0,0,0,101,102,5,44,0,0,102,8,1,0,0,0,103,104,5,40,0,0,104,10,1,0,