### 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_
13,7,13,2,14,7,14,2,15,7,15,2,16,7,16,2,17,7,17,2,18,7,18,2,19,7,
        19,2,20,7,20,2,21,7,21,2,22,7,22,2,23,7,23,2,24,7,24,2,25,7,25,2,
        26,7,26,2,27,7,27,2,28,7,28,2,29,7,29,2,30,7,30,2,31,7,31,2,32,7,
        32,2,33,7,33,2,34,7,34,2,35,7,35,2,36,7,36,2,37,7,37,2,38,7,38,2,
        39,7,39,2,40,7,40,2,41,7,41,2,42,7,42,2,43,7,43,2,44,7,44,2,45,7,
        45,2,46,7,46,1,0,1,0,1,1,1,1,1,2,1,2,1,3,1,3,1,4,1,4,1,5,1,5,1,6,
        1,6,1,7,1,7,1,8,1,8,1,9,1,9,1,10,1,10,1,10,1,11,1,11,1,11,1,11,1,
        11,1,11,1,11,1,11,1,11,1,11,1,12,1,12,1,12,1,13,1,13,1,13,1,14,1,
        14,1,14,1,15,1,15,1,16,1,16,1,16,1,16,1,16,1,17,1,17,1,17,1,17,1,
        17,1,17,1,18,1,18,1,18,1,18,1,18,1,18,1,18,1,19,1,19,1,19,1,19,1,
        19,1,19,1,19,1,20,1,20,1,20,1,20,1,20,1,20,1,20,1,20,1,20,1,20,1,
        20,1,20,1,20,1,21,1,21,1,21,1,21,1,21,1,21,1,21,1,21,1,21,1,21,1,
        21,1,21,1,21,1,22,1,22,1,22,1,22,1,22,1,22,1,23,1,23,1,23,1,23,1,
        23,1,23,1,23,1,23,1,23,1,23,1,23,1,23,1,23,1,23,1,23,1,24,1,24,1,
        24,1,24,1,24,1,24,1,24,1,24,1,24,1,24,1,24,1,24,1,24,1,24,1,25,1,
        25,1,25,1,25,1,25,1,25,1,25,1,25,1,25,1,25,1,25,1,26,1,26,1,26,1,
        26,1,26,1,26,1,26,1,26,1,26,1,26,1,26,1,26,1,26,1,27,1,27,1,27,1,
        27,1,27,1,27,1,27,1,27,1,27,1,27,1,27,1,27,1,28,1,28,1,28,1,28,1,
        28,1,28,1,28,1,28,1,28,1,28,1,28,1,28,1,29,1,29,1,29,1,29,1,29,1,
        29,1,29,1,29,1,29,1,29,1,29,1,29,1,29,1,30,1,30,1,30,1,30,1,30,1,
        30,1,30,1,30,1,30,1,30,1,30,1,30,1,30,1,31,1,31,1,31,1,31,1,31,1,
        32,1,32,1,32,1,32,1,32,1,32,1,32,1,32,1,32,1,32,1,33,1,33,1,33,1,
        33,1,33,1,33,1,33,1,33,1,33,1,33,1,33,1,34,1,34,1,34,1,34,1,34,1,
        34,1,34,1,34,1,35,1,35,1,35,1,35,1,35,1,35,1,35,1,35,1,35,1,35,1,
        35,1,35,1,36,1,36,1,36,1,36,1,36,1,37,1,37,1,37,5,37,354,8,37,10,
        37,12,37,357,9,37,1,37,1,37,1,38,1,38,1,38,3,38,364,8,38,1,39,1,
        39,1,39,1,39,1,39,1,39,1,40,1,40,1,41,1,41,1,42,3,42,377,8,42,1,
        42,1,42,1,42,5,42,382,8,42,10,42,12,42,385,9,42,3,42,387,8,42,1,
        43,3,43,390,8,43,1,43,1,43,1,43,4,43,395,8,43,11,43,12,43,396,3,
        43,399,8,43,1,43,3,43,402,8,43,1,44,1,44,3,44,406,8,44,1,44,1,44,