### 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_
110,0,0,219,220,5,116,0,0,220,221,5,97,0,0,221,222,5,105,0,0,222,
        223,5,110,0,0,223,224,5,115,0,0,224,50,1,0,0,0,225,226,5,65,0,0,
        226,227,5,114,0,0,227,228,5,114,0,0,228,229,5,97,0,0,229,230,5,121,
        0,0,230,231,5,82,0,0,231,232,5,97,0,0,232,233,5,110,0,0,233,234,
        5,103,0,0,234,235,5,101,0,0,235,52,1,0,0,0,236,237,5,65,0,0,237,
        238,5,114,0,0,238,239,5,114,0,0,239,240,5,97,0,0,240,241,5,121,0,
        0,241,242,5,71,0,0,242,243,5,101,0,0,243,244,5,116,0,0,244,245,5,
        73,0,0,245,246,5,116,0,0,246,247,5,101,0,0,247,248,5,109,0,0,248,
        54,1,0,0,0,249,250,5,65,0,0,250,251,5,114,0,0,251,252,5,114,0,0,
        252,253,5,97,0,0,253,254,5,121,0,0,254,255,5,76,0,0,255,256,5,101,
        0,0,256,257,5,110,0,0,257,258,5,103,0,0,258,259,5,116,0,0,259,260,
        5,104,0,0,260,56,1,0,0,0,261,262,5,65,0,0,262,263,5,114,0,0,263,
        264,5,114,0,0,264,265,5,97,0,0,265,266,5,121,0,0,266,267,5,85,0,
        0,267,268,5,110,0,0,268,269,5,105,0,0,269,270,5,113,0,0,270,271,
        5,117,0,0,271,272,5,101,0,0,272,58,1,0,0,0,273,274,5,66,0,0,274,
        275,5,97,0,0,275,276,5,115,0,0,276,277,5,101,0,0,277,278,5,54,0,
        0,278,279,5,52,0,0,279,280,5,69,0,0,280,281,5,110,0,0,281,282,5,
        99,0,0,282,283,5,111,0,0,283,284,5,100,0,0,284,285,5,101,0,0,285,
        60,1,0,0,0,286,287,5,66,0,0,287,288,5,97,0,0,288,289,5,115,0,0,289,
        290,5,101,0,0,290,291,5,54,0,0,291,292,5,52,0,0,292,293,5,68,0,0,
        293,294,5,101,0,0,294,295,5,99,0,0,295,296,5,111,0,0,296,297,5,100,
        0,0,297,298,5,101,0,0,298,62,1,0,0,0,299,300,5,72,0,0,300,301,5,
        97,0,0,301,302,5,115,0,0,302,303,5,104,0,0,303,64,1,0,0,0,304,305,
        5,74,0,0,305,306,5,115,0,0,306,307,5,111,0,0,307,308,5,110,0,0,308,
        309,5,77,0,0,309,310,5,101,0,0,310,311,5,114,0,0,311,312,5,103,0,
        0,312,313,5,101,0,0,313,66,1,0,0,0,314,315,5,77,0,0,315,316,5,97,
        0,0,316,317,5,116,0,0,317,318,5,104,0,0,318,319,5,82,0,0,319,320,
        5,97,0,0,320,321,5,110,0,0,321,322,5,100,0,0,322,323,5,111,0,0,323,
        324,5,109,0,0,324,68,1,0,0,0,325,326,5,77,0,0,326,327,5,97,0,0,327,
        328,5,116,0,0,328,329,5,104,0,0,329,330,5,65,0,0,330,331,5,100,0,