### 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_
0,0,105,106,5,41,0,0,106,12,1,0,0,0,107,108,5,91,0,0,108,14,1,0,
        0,0,109,110,5,93,0,0,110,16,1,0,0,0,111,112,5,60,0,0,112,18,1,0,
        0,0,113,114,5,62,0,0,114,20,1,0,0,0,115,116,5,64,0,0,116,117,5,46,
        0,0,117,22,1,0,0,0,118,119,5,64,0,0,119,120,5,46,0,0,120,121,5,108,
        0,0,121,122,5,101,0,0,122,123,5,110,0,0,123,124,5,103,0,0,124,125,
        5,116,0,0,125,126,5,104,0,0,126,127,5,45,0,0,127,24,1,0,0,0,128,
        129,5,38,0,0,129,130,5,38,0,0,130,26,1,0,0,0,131,132,5,124,0,0,132,
        133,5,124,0,0,133,28,1,0,0,0,134,135,5,61,0,0,135,136,5,61,0,0,136,
        30,1,0,0,0,137,138,5,61,0,0,138,32,1,0,0,0,139,140,5,116,0,0,140,
        141,5,114,0,0,141,142,5,117,0,0,142,143,5,101,0,0,143,34,1,0,0,0,
        144,145,5,102,0,0,145,146,5,97,0,0,146,147,5,108,0,0,147,148,5,115,
        0,0,148,149,5,101,0,0,149,36,1,0,0,0,150,151,5,83,0,0,151,152,5,
        116,0,0,152,153,5,97,0,0,153,154,5,116,0,0,154,155,5,101,0,0,155,
        156,5,115,0,0,156,38,1,0,0,0,157,158,5,70,0,0,158,159,5,111,0,0,
        159,160,5,114,0,0,160,161,5,109,0,0,161,162,5,97,0,0,162,163,5,116,
        0,0,163,40,1,0,0,0,164,165,5,83,0,0,165,166,5,116,0,0,166,167,5,
        114,0,0,167,168,5,105,0,0,168,169,5,110,0,0,169,170,5,103,0,0,170,
        171,5,84,0,0,171,172,5,111,0,0,172,173,5,74,0,0,173,174,5,115,0,
        0,174,175,5,111,0,0,175,176,5,110,0,0,176,42,1,0,0,0,177,178,5,74,
        0,0,178,179,5,115,0,0,179,180,5,111,0,0,180,181,5,110,0,0,181,182,
        5,84,0,0,182,183,5,111,0,0,183,184,5,83,0,0,184,185,5,116,0,0,185,
        186,5,114,0,0,186,187,5,105,0,0,187,188,5,110,0,0,188,189,5,103,
        0,0,189,44,1,0,0,0,190,191,5,65,0,0,191,192,5,114,0,0,192,193,5,
        114,0,0,193,194,5,97,0,0,194,195,5,121,0,0,195,46,1,0,0,0,196,197,
        5,65,0,0,197,198,5,114,0,0,198,199,5,114,0,0,199,200,5,97,0,0,200,
        201,5,121,0,0,201,202,5,80,0,0,202,203,5,97,0,0,203,204,5,114,0,
        0,204,205,5,116,0,0,205,206,5,105,0,0,206,207,5,116,0,0,207,208,
        5,105,0,0,208,209,5,111,0,0,209,210,5,110,0,0,210,48,1,0,0,0,211,
        212,5,65,0,0,212,213,5,114,0,0,213,214,5,114,0,0,214,215,5,97,0,
        0,215,216,5,121,0,0,216,217,5,67,0,0,217,218,5,111,0,0,218,219,5,