Replace one word within a variable

I am using decluttering-card template.

              - type: custom:decluttering-card
                template: from_to1
                variables:
                  - title: '[[v_title]]'
                  - v_ent: '[[v_ent]]'
                  - start_time: '[[v_begin_by]][[v_subject]]'

I am using the above code to determine input_datetime.
‘start_time’ become input_datetime.start_deco_balcons_led’

I wish to set another variables “end_time” by replacing the word ‘start’ by ‘end’ of my variable ‘start_time’

I can do it within Developer Tools as follow:

{% set v_begin_by = "input_datetime.start_deco_" %}
{% set v_subject = "balcons_led" %}
{% set start_time = v_begin_by  + v_subject %}
Start Time is         {{start_time}}
{% set end_time = start_time | replace ("start", "end") %}
End time is           {{end_time}}

But I cannot find the proper code to do in the decluttering-card, help would be appreciate